diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-08-13 22:26:20 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-08-13 22:56:33 -0700 |
commit | 84bad7440033ced38f8dfba1f839a6966fc88a5e (patch) | |
tree | 2f39e17936189c0c65f3f6af714668265000ad17 /src | |
parent | fa54bd814328faaf8116ec244c52c4eac0d512c0 (diff) |
main.c: Fixed reading of files specified on command line.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -67,16 +67,13 @@ int main(int argc, char *argv[]) { exit(1); } - struct bStream *stream = bsopen((bNread)fread, fp); - if (stream == NULL) { - printf("Error opening stream\n"); - } - while (bsreadln(s, stream, '\n') != BSTR_ERR) { + while ((s = bgets((bNgetc) fgetc, fp, '\n'))) { check(incorporate_line(s, linenum, &cur) == 0, - "error incorporating line %d of %s", linenum, argv[files[g]]); + "error incorporating line %d", linenum); + bdestroy(s); linenum++; } - bsclose(stream); + fclose(fp); } } |