diff options
author | David Phillips <david@sighup.nz> | 2018-08-02 00:02:11 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-08-02 00:02:11 +1200 |
commit | 3a4a4b1f40b1492f814eb03a8001674972b8c04a (patch) | |
tree | a2be66a24bbf8745f2d1b71c765ad19b86b20c00 | |
parent | 784b4c9e35eb166161cfcfbb98515834bb053a75 (diff) | |
download | hence-3a4a4b1f40b1492f814eb03a8001674972b8c04a.tar.xz |
No need for line_start variable
-rw-r--r-- | common.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -8,7 +8,6 @@ indicate_file_area(FILE* fd, size_t line, size_t column, size_t span) { char buf[1024] = { '\0' }; char *s = buf; - char *line_start = buf; rewind(fd); while (line && !feof(fd) && fgets(buf, sizeof(buf), fd)) { @@ -20,12 +19,13 @@ indicate_file_area(FILE* fd, size_t line, size_t column, size_t span) { } } - while (*line_start == '\t' || *line_start == ' ') { - line_start++; + s = buf; + while (*s == '\t' || *s == ' ') { + s++; } fputs(margin, stderr); - fputs(line_start, stderr); + fputs(s, stderr); /* corner case (still needed?) - buf was just return */ if (strlen(buf) == 1 && buf[0] == '\n') { |