aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-08-29 13:29:02 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-08-29 13:29:02 +0200
commitb32a5436633f53f0abf0fa29105cf7e5b65091cf (patch)
treee84b5d75ddee2a7bc3cb8a42d9ee669c15ba6e6f
parenta78227dc7320738ec930edbde1aaa0023a51ee4c (diff)
downloadbusybox-w32-b32a5436633f53f0abf0fa29105cf7e5b65091cf.tar.gz
busybox-w32-b32a5436633f53f0abf0fa29105cf7e5b65091cf.tar.bz2
busybox-w32-b32a5436633f53f0abf0fa29105cf7e5b65091cf.zip
nandwrite: complain on malformed -s NUM
Elsewhere: use common error message. -30 bytes net size change Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/printf.c4
-rw-r--r--miscutils/nandwrite.c2
-rw-r--r--procps/kill.c4
-rw-r--r--procps/renice.c2
-rw-r--r--shell/shell_common.c2
5 files changed, 8 insertions, 6 deletions
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 3497148e3..2cc238439 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -66,7 +66,7 @@ static int multiconvert(const char *arg, void *result, converter convert)
66 errno = 0; 66 errno = 0;
67 convert(arg, result); 67 convert(arg, result);
68 if (errno) { 68 if (errno) {
69 bb_error_msg("%s: invalid number", arg); 69 bb_error_msg("invalid number '%s'", arg);
70 return 1; 70 return 1;
71 } 71 }
72 return 0; 72 return 0;
@@ -230,7 +230,7 @@ static int get_width_prec(const char *str)
230{ 230{
231 int v = bb_strtoi(str, NULL, 10); 231 int v = bb_strtoi(str, NULL, 10);
232 if (errno) { 232 if (errno) {
233 bb_error_msg("%s: invalid number", str); 233 bb_error_msg("invalid number '%s'", str);
234 v = 0; 234 v = 0;
235 } 235 }
236 return v; 236 return v;
diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c
index d0e4397fb..8df0fdc81 100644
--- a/miscutils/nandwrite.c
+++ b/miscutils/nandwrite.c
@@ -72,6 +72,8 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
72 xioctl(fd, MEMGETINFO, &meminfo); 72 xioctl(fd, MEMGETINFO, &meminfo);
73 73
74 mtdoffset = bb_strtou(opt_s, NULL, 0); 74 mtdoffset = bb_strtou(opt_s, NULL, 0);
75 if (errno)
76 bb_error_msg_and_die("invalid number '%s'", opt_s);
75 77
76 /* Pull it into a CPU register (hopefully) - smaller code that way */ 78 /* Pull it into a CPU register (hopefully) - smaller code that way */
77 meminfo_writesize = meminfo.writesize; 79 meminfo_writesize = meminfo.writesize;
diff --git a/procps/kill.c b/procps/kill.c
index 4ed94b0ec..b51d44a70 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -153,7 +153,7 @@ int kill_main(int argc, char **argv)
153 arg = argv[i]; 153 arg = argv[i];
154 omit = bb_strtoi(arg, NULL, 10); 154 omit = bb_strtoi(arg, NULL, 10);
155 if (errno) { 155 if (errno) {
156 bb_error_msg("bad pid '%s'", arg); 156 bb_error_msg("invalid number '%s'", arg);
157 ret = 1; 157 ret = 1;
158 goto resume; 158 goto resume;
159 } 159 }
@@ -211,7 +211,7 @@ int kill_main(int argc, char **argv)
211 arg++; 211 arg++;
212 pid = bb_strtoi(arg, NULL, 10); 212 pid = bb_strtoi(arg, NULL, 10);
213 if (errno) { 213 if (errno) {
214 bb_error_msg("bad pid '%s'", arg); 214 bb_error_msg("invalid number '%s'", arg);
215 errors++; 215 errors++;
216 } else if (kill(pid, signo) != 0) { 216 } else if (kill(pid, signo) != 0) {
217 bb_perror_msg("can't kill pid %d", (int)pid); 217 bb_perror_msg("can't kill pid %d", (int)pid);
diff --git a/procps/renice.c b/procps/renice.c
index 81ee89cfb..0a73cbeeb 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -91,7 +91,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv)
91 } else { 91 } else {
92 who = bb_strtou(arg, NULL, 10); 92 who = bb_strtou(arg, NULL, 10);
93 if (errno) { 93 if (errno) {
94 bb_error_msg("bad value: %s", arg); 94 bb_error_msg("invalid number '%s'", arg);
95 goto HAD_ERROR; 95 goto HAD_ERROR;
96 } 96 }
97 } 97 }
diff --git a/shell/shell_common.c b/shell/shell_common.c
index 9345005c7..e9effd2d0 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -422,7 +422,7 @@ shell_builtin_ulimit(char **argv)
422 else 422 else
423 val = bb_strtoull(val_str, NULL, 10); 423 val = bb_strtoull(val_str, NULL, 10);
424 if (errno) { 424 if (errno) {
425 bb_error_msg("bad number"); 425 bb_error_msg("invalid number '%s'", val_str);
426 return EXIT_FAILURE; 426 return EXIT_FAILURE;
427 } 427 }
428 val <<= l->factor_shift; 428 val <<= l->factor_shift;