diff options
Diffstat (limited to 'toolbox/grep/grep.c')
-rw-r--r-- | toolbox/grep/grep.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/toolbox/grep/grep.c b/toolbox/grep/grep.c index b5bb2ef..7b2c487 100644 --- a/toolbox/grep/grep.c +++ b/toolbox/grep/grep.c @@ -294,10 +294,8 @@ read_patterns(const char *fn) err(2, "%s", fn); line = NULL; len = 0; -#ifndef ANDROID while ((rlen = getline(&line, &len, f)) != -1) add_pattern(line, *line == '\n' ? 0 : (size_t)rlen); -#endif free(line); if (ferror(f)) err(2, "%s", fn); @@ -405,7 +403,7 @@ grep_main(int argc, char *argv[]) Aflag = 0; else if (Aflag > LLONG_MAX / 10) { errno = ERANGE; - err(2, NULL); + err(2, "%llu", Aflag); } Aflag = Bflag = (Aflag * 10) + (c - '0'); break; @@ -422,10 +420,10 @@ grep_main(int argc, char *argv[]) l = strtoull(optarg, &ep, 10); if (((errno == ERANGE) && (l == ULLONG_MAX)) || ((errno == EINVAL) && (l == 0))) - err(2, NULL); + err(2, "strtoull"); else if (ep[0] != '\0') { errno = EINVAL; - err(2, NULL); + err(2, "empty"); } if (c == 'A') Aflag = l; @@ -511,10 +509,10 @@ grep_main(int argc, char *argv[]) mcount = strtoull(optarg, &ep, 10); if (((errno == ERANGE) && (mcount == ULLONG_MAX)) || ((errno == EINVAL) && (mcount == 0))) - err(2, NULL); + err(2, "strtoull"); else if (ep[0] != '\0') { errno = EINVAL; - err(2, NULL); + err(2, "empty"); } break; case 'n': |