summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index a4b6949..e291f90 100644
--- a/util.c
+++ b/util.c
@@ -36,6 +36,7 @@ static struct {
{ .look = TOKEN_IDENT , .str = "identifier" },
{ .look = TOKEN_DOT , .str = "assembler directive" },
{ .look = TOKEN_EOL , .str = "end of line" },
+ { .look = TOKEN_EOF , .str = "end of file" },
{ .str = NULL },
};
@@ -191,8 +192,8 @@ void indicate_file_area(FILE* fd, size_t line, size_t column, size_t span)
fputs(margin, stderr);
fputs(s, stderr);
- /* corner case (still needed?) - buf was just return */
- if (strlen(buf) == 1 && buf[0] == '\n') {
+ /* corner case: buf had no return */
+ if (s[strlen(s) - 1] != '\n') {
fputc('\n', stderr);
}