From 84bad7440033ced38f8dfba1f839a6966fc88a5e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 13 Aug 2014 22:26:20 -0700 Subject: main.c: Fixed reading of files specified on command line. --- src/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 40a63bc..fa334b3 100644 --- a/src/main.c +++ b/src/main.c @@ -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); } } -- cgit v1.2.3