summaryrefslogtreecommitdiffstats
path: root/toolbox/grep/grep.c
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-05-08 09:31:43 -0700
committerMark Salyzyn <salyzyn@google.com>2014-05-14 12:41:24 -0700
commitaa907768af7ba9e29901d356cdcac6a436970323 (patch)
tree37b375fc862fad56969e14243bcd394d4a8e91b2 /toolbox/grep/grep.c
parent3fe8afa404a4317807c7116fdab40f2506713396 (diff)
downloadsystem_core-aa907768af7ba9e29901d356cdcac6a436970323.zip
system_core-aa907768af7ba9e29901d356cdcac6a436970323.tar.gz
system_core-aa907768af7ba9e29901d356cdcac6a436970323.tar.bz2
toolbox: turn on -Werror
- Deal with some signedness issues - Deal with some size issues - Deal with NULL pointer issues - Deal with some -Wunused issues Change-Id: I1479dd90d690084491bae3475f2c547833519a57
Diffstat (limited to 'toolbox/grep/grep.c')
-rw-r--r--toolbox/grep/grep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toolbox/grep/grep.c b/toolbox/grep/grep.c
index 5a4fa0c..7b2c487 100644
--- a/toolbox/grep/grep.c
+++ b/toolbox/grep/grep.c
@@ -403,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;
@@ -420,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;
@@ -509,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':