diff options
-rw-r--r-- | src/grep.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -71,7 +71,8 @@ int main(int argc, char **argv) static const char *optpat = "EFce:f:ilnqsvx"; FILE *f; char *line = 0; - ssize_t llen = 0; + size_t lsize = 0; + ssize_t llen; int b; int multifile; struct pattern *pat; @@ -139,7 +140,7 @@ int main(int argc, char **argv) process_stdin: count = 0; lineno = 0; - while ((llen = getline(&line, (size_t[]){0}, f)) >= 0) { + while ((llen = getline(&line, &lsize, f)) >= 0) { lineno++; if (llen && line[llen-1]=='\n') line[--llen] = 0; |