| Date: Sat, 25 Nov 2017 15:13:40 +0100
index: read until the first newline or CR or TAB
This makes sure the column is properly aligned also, because a newline is
ignored, but it is counted in utf8pad().
Diffstat:
M stagit-gopher-index.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- |
| @@ -264,7 +264,9 @@ main(int argc, char *argv[])
}
description[0] = '\0';
if (fp) {
- if (!fgets(description, sizeof(description), fp))
+ if (fgets(description, sizeof(description), fp))
+ description[strcspn(description, "\t\r\n")] = '\0';
+ else
description[0] = '\0';
fclose(fp);
} |