diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-12 14:14:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-12 14:14:45 +0200 |
commit | 7783248eaac715b813f0635b06cc140ea99bb4d9 (patch) | |
tree | b7c3acbdf7e45afdb31a721a693f0a8a65f80730 | |
parent | 7bfbbd434a6f435b0287cd25406927c630b03f68 (diff) | |
download | busybox-w32-7783248eaac715b813f0635b06cc140ea99bb4d9.tar.gz busybox-w32-7783248eaac715b813f0635b06cc140ea99bb4d9.tar.bz2 busybox-w32-7783248eaac715b813f0635b06cc140ea99bb4d9.zip |
*: s/xatoi_u/xatoi_positive/g - I got bored of mistyping xatoi_u as xatou_i
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/cut.c | 4 | ||||
-rw-r--r-- | coreutils/date.c | 2 | ||||
-rw-r--r-- | debianutils/start_stop_daemon.c | 2 | ||||
-rw-r--r-- | e2fsprogs/fsck.c | 4 | ||||
-rw-r--r-- | e2fsprogs/old_e2fsprogs/mke2fs.c | 6 | ||||
-rw-r--r-- | findutils/find.c | 2 | ||||
-rw-r--r-- | include/libbb.h | 11 | ||||
-rw-r--r-- | libbb/getopt32.c | 6 | ||||
-rw-r--r-- | libbb/xatonum.c | 2 | ||||
-rw-r--r-- | miscutils/fbsplash.c | 2 | ||||
-rw-r--r-- | miscutils/hdparm.c | 4 | ||||
-rw-r--r-- | miscutils/ionice.c | 2 | ||||
-rw-r--r-- | miscutils/makedevs.c | 8 | ||||
-rw-r--r-- | miscutils/mt.c | 2 | ||||
-rw-r--r-- | miscutils/rfkill.c | 2 | ||||
-rw-r--r-- | networking/brctl.c | 2 | ||||
-rw-r--r-- | networking/ftpd.c | 2 | ||||
-rw-r--r-- | networking/wget.c | 2 | ||||
-rw-r--r-- | printutils/lpd.c | 2 | ||||
-rw-r--r-- | procps/iostat.c | 4 | ||||
-rw-r--r-- | procps/mpstat.c | 6 | ||||
-rw-r--r-- | procps/nmeter.c | 2 | ||||
-rw-r--r-- | runit/svlogd.c | 6 | ||||
-rw-r--r-- | shell/hush.c | 2 | ||||
-rw-r--r-- | util-linux/flock.c | 2 | ||||
-rw-r--r-- | util-linux/hexdump.c | 2 | ||||
-rw-r--r-- | util-linux/mount.c | 2 |
27 files changed, 49 insertions, 44 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c index 696478bb2..b7a3cfabb 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
@@ -224,7 +224,7 @@ int cut_main(int argc UNUSED_PARAM, char **argv) | |||
224 | if (!ntok[0]) { | 224 | if (!ntok[0]) { |
225 | s = BOL; | 225 | s = BOL; |
226 | } else { | 226 | } else { |
227 | s = xatoi_u(ntok); | 227 | s = xatoi_positive(ntok); |
228 | /* account for the fact that arrays are zero based, while | 228 | /* account for the fact that arrays are zero based, while |
229 | * the user expects the first char on the line to be char #1 */ | 229 | * the user expects the first char on the line to be char #1 */ |
230 | if (s != 0) | 230 | if (s != 0) |
@@ -237,7 +237,7 @@ int cut_main(int argc UNUSED_PARAM, char **argv) | |||
237 | } else if (!ltok[0]) { | 237 | } else if (!ltok[0]) { |
238 | e = EOL; | 238 | e = EOL; |
239 | } else { | 239 | } else { |
240 | e = xatoi_u(ltok); | 240 | e = xatoi_positive(ltok); |
241 | /* if the user specified and end position of 0, | 241 | /* if the user specified and end position of 0, |
242 | * that means "til the end of the line" */ | 242 | * that means "til the end of the line" */ |
243 | if (e == 0) | 243 | if (e == 0) |
diff --git a/coreutils/date.c b/coreutils/date.c index cb41724af..3ce352c8d 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -300,7 +300,7 @@ int date_main(int argc UNUSED_PARAM, char **argv) | |||
300 | scale = 1; | 300 | scale = 1; |
301 | pres = 9; | 301 | pres = 9; |
302 | if (n) { | 302 | if (n) { |
303 | pres = xatoi_u(p); | 303 | pres = xatoi_positive(p); |
304 | if (pres == 0) | 304 | if (pres == 0) |
305 | pres = 9; | 305 | pres = 9; |
306 | m = 9 - pres; | 306 | m = 9 - pres; |
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index 665f38fbd..568f32eec 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c | |||
@@ -373,7 +373,7 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv) | |||
373 | 373 | ||
374 | // IF_FEATURE_START_STOP_DAEMON_FANCY( | 374 | // IF_FEATURE_START_STOP_DAEMON_FANCY( |
375 | // if (retry_arg) | 375 | // if (retry_arg) |
376 | // retries = xatoi_u(retry_arg); | 376 | // retries = xatoi_positive(retry_arg); |
377 | // ) | 377 | // ) |
378 | //argc -= optind; | 378 | //argc -= optind; |
379 | argv += optind; | 379 | argv += optind; |
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index 7c449e3e7..d694bb110 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c | |||
@@ -972,13 +972,13 @@ int fsck_main(int argc UNUSED_PARAM, char **argv) | |||
972 | case 'C': | 972 | case 'C': |
973 | progress = 1; | 973 | progress = 1; |
974 | if (arg[++j]) { /* -Cn */ | 974 | if (arg[++j]) { /* -Cn */ |
975 | progress_fd = xatoi_u(&arg[j]); | 975 | progress_fd = xatoi_positive(&arg[j]); |
976 | goto next_arg; | 976 | goto next_arg; |
977 | } | 977 | } |
978 | /* -C n */ | 978 | /* -C n */ |
979 | if (!*++argv) | 979 | if (!*++argv) |
980 | bb_show_usage(); | 980 | bb_show_usage(); |
981 | progress_fd = xatoi_u(*argv); | 981 | progress_fd = xatoi_positive(*argv); |
982 | goto next_arg; | 982 | goto next_arg; |
983 | #endif | 983 | #endif |
984 | case 'V': | 984 | case 'V': |
diff --git a/e2fsprogs/old_e2fsprogs/mke2fs.c b/e2fsprogs/old_e2fsprogs/mke2fs.c index 520364550..f1e97b96a 100644 --- a/e2fsprogs/old_e2fsprogs/mke2fs.c +++ b/e2fsprogs/old_e2fsprogs/mke2fs.c | |||
@@ -895,7 +895,7 @@ static int PRS(int argc, char **argv) | |||
895 | creator_os = optarg; | 895 | creator_os = optarg; |
896 | break; | 896 | break; |
897 | case 'r': | 897 | case 'r': |
898 | param.s_rev_level = xatoi_u(optarg); | 898 | param.s_rev_level = xatoi_positive(optarg); |
899 | if (param.s_rev_level == EXT2_GOOD_OLD_REV) { | 899 | if (param.s_rev_level == EXT2_GOOD_OLD_REV) { |
900 | param.s_feature_incompat = 0; | 900 | param.s_feature_incompat = 0; |
901 | param.s_feature_compat = 0; | 901 | param.s_feature_compat = 0; |
@@ -912,11 +912,11 @@ static int PRS(int argc, char **argv) | |||
912 | break; | 912 | break; |
913 | #ifdef EXT2_DYNAMIC_REV | 913 | #ifdef EXT2_DYNAMIC_REV |
914 | case 'I': | 914 | case 'I': |
915 | inode_size = xatoi_u(optarg); | 915 | inode_size = xatoi_positive(optarg); |
916 | break; | 916 | break; |
917 | #endif | 917 | #endif |
918 | case 'N': | 918 | case 'N': |
919 | num_inodes = xatoi_u(optarg); | 919 | num_inodes = xatoi_positive(optarg); |
920 | break; | 920 | break; |
921 | case 'v': | 921 | case 'v': |
922 | quiet = 0; | 922 | quiet = 0; |
diff --git a/findutils/find.c b/findutils/find.c index 297081489..d4bcd6545 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -1210,7 +1210,7 @@ IF_FEATURE_FIND_MAXDEPTH(OPT_MINDEPTH,) | |||
1210 | if (opt == OPT_MINDEPTH || opt == OPT_MINDEPTH + 1) { | 1210 | if (opt == OPT_MINDEPTH || opt == OPT_MINDEPTH + 1) { |
1211 | if (!argp[1]) | 1211 | if (!argp[1]) |
1212 | bb_show_usage(); | 1212 | bb_show_usage(); |
1213 | minmaxdepth[opt - OPT_MINDEPTH] = xatoi_u(argp[1]); | 1213 | minmaxdepth[opt - OPT_MINDEPTH] = xatoi_positive(argp[1]); |
1214 | argp[0] = (char*)"-a"; | 1214 | argp[0] = (char*)"-a"; |
1215 | argp[1] = (char*)"-a"; | 1215 | argp[1] = (char*)"-a"; |
1216 | argp++; | 1216 | argp++; |
diff --git a/include/libbb.h b/include/libbb.h index 118d777bc..03fc5d44b 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -190,7 +190,7 @@ typedef unsigned long long uoff_t; | |||
190 | /* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. | 190 | /* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. |
191 | * gcc will throw warnings on printf("%d", off_t). Crap... */ | 191 | * gcc will throw warnings on printf("%d", off_t). Crap... */ |
192 | typedef unsigned long uoff_t; | 192 | typedef unsigned long uoff_t; |
193 | # define XATOOFF(a) xatoi_u(a) | 193 | # define XATOOFF(a) xatoi_positive(a) |
194 | # define BB_STRTOOFF bb_strtou | 194 | # define BB_STRTOOFF bb_strtou |
195 | # define STRTOOFF strtol | 195 | # define STRTOOFF strtol |
196 | # define OFF_FMT "l" | 196 | # define OFF_FMT "l" |
@@ -765,11 +765,16 @@ struct suffix_mult { | |||
765 | }; | 765 | }; |
766 | #include "xatonum.h" | 766 | #include "xatonum.h" |
767 | /* Specialized: */ | 767 | /* Specialized: */ |
768 | |||
768 | /* Using xatoi() instead of naive atoi() is not always convenient - | 769 | /* Using xatoi() instead of naive atoi() is not always convenient - |
769 | * in many places people want *non-negative* values, but store them | 770 | * in many places people want *non-negative* values, but store them |
770 | * in signed int. Therefore we need this one: | 771 | * in signed int. Therefore we need this one: |
771 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */ | 772 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc. |
772 | int xatoi_u(const char *numstr) FAST_FUNC; | 773 | * It should really be named xatoi_nonnegative (since it allows 0), |
774 | * but that would be too long. | ||
775 | */ | ||
776 | int xatoi_positive(const char *numstr) FAST_FUNC; | ||
777 | |||
773 | /* Useful for reading port numbers */ | 778 | /* Useful for reading port numbers */ |
774 | uint16_t xatou16(const char *numstr) FAST_FUNC; | 779 | uint16_t xatou16(const char *numstr) FAST_FUNC; |
775 | 780 | ||
diff --git a/libbb/getopt32.c b/libbb/getopt32.c index b5f83c127..8c87fe3f0 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c | |||
@@ -233,7 +233,7 @@ Special characters: | |||
233 | 233 | ||
234 | "a+" A plus after a char in opt_complementary means that the parameter | 234 | "a+" A plus after a char in opt_complementary means that the parameter |
235 | for this option is a nonnegative integer. It will be processed | 235 | for this option is a nonnegative integer. It will be processed |
236 | with xatoi_u() - allowed range is 0..INT_MAX. | 236 | with xatoi_positive() - allowed range is 0..INT_MAX. |
237 | 237 | ||
238 | int param; // "unsigned param;" will also work | 238 | int param; // "unsigned param;" will also work |
239 | opt_complementary = "p+"; | 239 | opt_complementary = "p+"; |
@@ -579,8 +579,8 @@ getopt32(char **argv, const char *applet_opts, ...) | |||
579 | llist_add_to_end((llist_t **)(on_off->optarg), optarg); | 579 | llist_add_to_end((llist_t **)(on_off->optarg), optarg); |
580 | } else if (on_off->param_type == PARAM_INT) { | 580 | } else if (on_off->param_type == PARAM_INT) { |
581 | if (optarg) | 581 | if (optarg) |
582 | //TODO: xatoi_u indirectly pulls in printf machinery | 582 | //TODO: xatoi_positive indirectly pulls in printf machinery |
583 | *(unsigned*)(on_off->optarg) = xatoi_u(optarg); | 583 | *(unsigned*)(on_off->optarg) = xatoi_positive(optarg); |
584 | } else if (on_off->optarg) { | 584 | } else if (on_off->optarg) { |
585 | if (optarg) | 585 | if (optarg) |
586 | *(char **)(on_off->optarg) = optarg; | 586 | *(char **)(on_off->optarg) = optarg; |
diff --git a/libbb/xatonum.c b/libbb/xatonum.c index 3cdf63425..60b65f525 100644 --- a/libbb/xatonum.c +++ b/libbb/xatonum.c | |||
@@ -59,7 +59,7 @@ unsigned bb_strtoui(const char *str, char **end, int b) | |||
59 | 59 | ||
60 | /* A few special cases */ | 60 | /* A few special cases */ |
61 | 61 | ||
62 | int FAST_FUNC xatoi_u(const char *numstr) | 62 | int FAST_FUNC xatoi_positive(const char *numstr) |
63 | { | 63 | { |
64 | return xatou_range(numstr, 0, INT_MAX); | 64 | return xatou_range(numstr, 0, INT_MAX); |
65 | } | 65 | } |
diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index e370d207b..a031cbd3a 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c | |||
@@ -311,7 +311,7 @@ static void init(const char *cfg_filename) | |||
311 | parser_t *parser = config_open2(cfg_filename, xfopen_stdin); | 311 | parser_t *parser = config_open2(cfg_filename, xfopen_stdin); |
312 | while (config_read(parser, token, 2, 2, "#=", | 312 | while (config_read(parser, token, 2, 2, "#=", |
313 | (PARSE_NORMAL | PARSE_MIN_DIE) & ~(PARSE_TRIM | PARSE_COLLAPSE))) { | 313 | (PARSE_NORMAL | PARSE_MIN_DIE) & ~(PARSE_TRIM | PARSE_COLLAPSE))) { |
314 | unsigned val = xatoi_u(token[1]); | 314 | unsigned val = xatoi_positive(token[1]); |
315 | int i = index_in_strings(param_names, token[0]); | 315 | int i = index_in_strings(param_names, token[0]); |
316 | if (i < 0) | 316 | if (i < 0) |
317 | bb_error_msg_and_die("syntax error: %s", token[0]); | 317 | bb_error_msg_and_die("syntax error: %s", token[0]); |
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 236b1749c..c6ca3af80 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c | |||
@@ -2055,8 +2055,8 @@ int hdparm_main(int argc, char **argv) | |||
2055 | #if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF | 2055 | #if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF |
2056 | if (c == 'R') { | 2056 | if (c == 'R') { |
2057 | scan_hwif = parse_opts_0_INTMAX(&hwif_data); | 2057 | scan_hwif = parse_opts_0_INTMAX(&hwif_data); |
2058 | hwif_ctrl = xatoi_u((argv[optind]) ? argv[optind] : ""); | 2058 | hwif_ctrl = xatoi_positive((argv[optind]) ? argv[optind] : ""); |
2059 | hwif_irq = xatoi_u((argv[optind+1]) ? argv[optind+1] : ""); | 2059 | hwif_irq = xatoi_positive((argv[optind+1]) ? argv[optind+1] : ""); |
2060 | /* Move past the 2 additional arguments */ | 2060 | /* Move past the 2 additional arguments */ |
2061 | argv += 2; | 2061 | argv += 2; |
2062 | argc -= 2; | 2062 | argc -= 2; |
diff --git a/miscutils/ionice.c b/miscutils/ionice.c index 52e51b908..6b791c491 100644 --- a/miscutils/ionice.c +++ b/miscutils/ionice.c | |||
@@ -73,7 +73,7 @@ int ionice_main(int argc UNUSED_PARAM, char **argv) | |||
73 | 73 | ||
74 | if (!(opt & (OPT_n|OPT_c))) { | 74 | if (!(opt & (OPT_n|OPT_c))) { |
75 | if (!(opt & OPT_p) && *argv) | 75 | if (!(opt & OPT_p) && *argv) |
76 | pid = xatoi_u(*argv); | 76 | pid = xatoi_positive(*argv); |
77 | 77 | ||
78 | pri = ioprio_get(IOPRIO_WHO_PROCESS, pid); | 78 | pri = ioprio_get(IOPRIO_WHO_PROCESS, pid); |
79 | if (pri == -1) | 79 | if (pri == -1) |
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index abf505770..0578d9251 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c | |||
@@ -36,10 +36,10 @@ int makedevs_main(int argc, char **argv) | |||
36 | basedev = argv[1]; | 36 | basedev = argv[1]; |
37 | buf = xasprintf("%s%u", argv[1], (unsigned)-1); | 37 | buf = xasprintf("%s%u", argv[1], (unsigned)-1); |
38 | type = argv[2]; | 38 | type = argv[2]; |
39 | Smajor = xatoi_u(argv[3]); | 39 | Smajor = xatoi_positive(argv[3]); |
40 | Sminor = xatoi_u(argv[4]); | 40 | Sminor = xatoi_positive(argv[4]); |
41 | S = xatoi_u(argv[5]); | 41 | S = xatoi_positive(argv[5]); |
42 | E = xatoi_u(argv[6]); | 42 | E = xatoi_positive(argv[6]); |
43 | nodname = argv[7] ? basedev : buf; | 43 | nodname = argv[7] ? basedev : buf; |
44 | 44 | ||
45 | mode = 0660; | 45 | mode = 0660; |
diff --git a/miscutils/mt.c b/miscutils/mt.c index 586373d13..8df2b75f7 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c | |||
@@ -106,7 +106,7 @@ int mt_main(int argc UNUSED_PARAM, char **argv) | |||
106 | 106 | ||
107 | op.mt_op = opcode_value[idx]; | 107 | op.mt_op = opcode_value[idx]; |
108 | if (argv[2]) | 108 | if (argv[2]) |
109 | op.mt_count = xatoi_u(argv[2]); | 109 | op.mt_count = xatoi_positive(argv[2]); |
110 | else | 110 | else |
111 | op.mt_count = 1; /* One, not zero, right? */ | 111 | op.mt_count = 1; /* One, not zero, right? */ |
112 | 112 | ||
diff --git a/miscutils/rfkill.c b/miscutils/rfkill.c index 0f5817b76..7d8ad1cfc 100644 --- a/miscutils/rfkill.c +++ b/miscutils/rfkill.c | |||
@@ -53,7 +53,7 @@ int rfkill_main(int argc UNUSED_PARAM, char **argv) | |||
53 | rf_name = "uwb"; | 53 | rf_name = "uwb"; |
54 | rf_type = index_in_strings(rfkill_types, rf_name); | 54 | rf_type = index_in_strings(rfkill_types, rf_name); |
55 | if (rf_type < 0) { | 55 | if (rf_type < 0) { |
56 | rf_idx = xatoi_u(rf_name); | 56 | rf_idx = xatoi_positive(rf_name); |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
diff --git a/networking/brctl.c b/networking/brctl.c index a36ab45c3..0f56412ce 100644 --- a/networking/brctl.c +++ b/networking/brctl.c | |||
@@ -271,7 +271,7 @@ int brctl_main(int argc UNUSED_PARAM, char **argv) | |||
271 | } | 271 | } |
272 | } | 272 | } |
273 | arg1 = port; | 273 | arg1 = port; |
274 | arg2 = xatoi_u(*argv); | 274 | arg2 = xatoi_positive(*argv); |
275 | if (key == ARG_setbridgeprio) { | 275 | if (key == ARG_setbridgeprio) { |
276 | arg1 = arg2; | 276 | arg1 = arg2; |
277 | arg2 = 0; | 277 | arg2 = 0; |
diff --git a/networking/ftpd.c b/networking/ftpd.c index e8cae0a36..0daf9f7a3 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -534,7 +534,7 @@ static void | |||
534 | handle_rest(void) | 534 | handle_rest(void) |
535 | { | 535 | { |
536 | /* When ftp_arg == NULL simply restart from beginning */ | 536 | /* When ftp_arg == NULL simply restart from beginning */ |
537 | G.restart_pos = G.ftp_arg ? xatoi_u(G.ftp_arg) : 0; | 537 | G.restart_pos = G.ftp_arg ? xatoi_positive(G.ftp_arg) : 0; |
538 | WRITE_OK(FTP_RESTOK); | 538 | WRITE_OK(FTP_RESTOK); |
539 | } | 539 | } |
540 | 540 | ||
diff --git a/networking/wget.c b/networking/wget.c index fb8e51317..784e405da 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -213,7 +213,7 @@ static int ftpcmd(const char *s1, const char *s2, FILE *fp, char *buf) | |||
213 | } while (!isdigit(buf[0]) || buf[3] != ' '); | 213 | } while (!isdigit(buf[0]) || buf[3] != ' '); |
214 | 214 | ||
215 | buf[3] = '\0'; | 215 | buf[3] = '\0'; |
216 | result = xatoi_u(buf); | 216 | result = xatoi_positive(buf); |
217 | buf[3] = ' '; | 217 | buf[3] = ' '; |
218 | return result; | 218 | return result; |
219 | } | 219 | } |
diff --git a/printutils/lpd.c b/printutils/lpd.c index d91491f1b..54ff2227e 100644 --- a/printutils/lpd.c +++ b/printutils/lpd.c | |||
@@ -135,7 +135,7 @@ int lpd_main(int argc UNUSED_PARAM, char *argv[]) | |||
135 | while (1) { | 135 | while (1) { |
136 | char *fname; | 136 | char *fname; |
137 | int fd; | 137 | int fd; |
138 | // int is easier than ssize_t: can use xatoi_u, | 138 | // int is easier than ssize_t: can use xatoi_positive, |
139 | // and can correctly display error returns (-1) | 139 | // and can correctly display error returns (-1) |
140 | int expected_len, real_len; | 140 | int expected_len, real_len; |
141 | 141 | ||
diff --git a/procps/iostat.c b/procps/iostat.c index 573419e1c..8641c2391 100644 --- a/procps/iostat.c +++ b/procps/iostat.c | |||
@@ -539,12 +539,12 @@ int iostat_main(int argc, char **argv) | |||
539 | 539 | ||
540 | if (*argv) { | 540 | if (*argv) { |
541 | /* Get interval */ | 541 | /* Get interval */ |
542 | interval = xatoi_u(*argv); | 542 | interval = xatoi_positive(*argv); |
543 | count = interval ? -1 : 1; | 543 | count = interval ? -1 : 1; |
544 | argv++; | 544 | argv++; |
545 | if (*argv) | 545 | if (*argv) |
546 | /* Get count value */ | 546 | /* Get count value */ |
547 | count = xatoi_u(*argv); | 547 | count = xatoi_positive(*argv); |
548 | } | 548 | } |
549 | 549 | ||
550 | /* Allocate space for device stats */ | 550 | /* Allocate space for device stats */ |
diff --git a/procps/mpstat.c b/procps/mpstat.c index 7610a68fb..85cbb45db 100644 --- a/procps/mpstat.c +++ b/procps/mpstat.c | |||
@@ -930,14 +930,14 @@ int mpstat_main(int UNUSED_PARAM argc, char **argv) | |||
930 | 930 | ||
931 | if (*argv) { | 931 | if (*argv) { |
932 | /* Get interval */ | 932 | /* Get interval */ |
933 | G.interval = xatoi_u(*argv); | 933 | G.interval = xatoi_positive(*argv); |
934 | G.count = -1; | 934 | G.count = -1; |
935 | argv++; | 935 | argv++; |
936 | if (*argv) { | 936 | if (*argv) { |
937 | /* Get count value */ | 937 | /* Get count value */ |
938 | if (G.interval == 0) | 938 | if (G.interval == 0) |
939 | bb_show_usage(); | 939 | bb_show_usage(); |
940 | G.count = xatoi_u(*argv); | 940 | G.count = xatoi_positive(*argv); |
941 | //if (*++argv) | 941 | //if (*++argv) |
942 | // bb_show_usage(); | 942 | // bb_show_usage(); |
943 | } | 943 | } |
@@ -979,7 +979,7 @@ int mpstat_main(int UNUSED_PARAM argc, char **argv) | |||
979 | memset(G.cpu_bitmap, 0xff, G.cpu_bitmap_len); | 979 | memset(G.cpu_bitmap, 0xff, G.cpu_bitmap_len); |
980 | } else { | 980 | } else { |
981 | /* Get CPU number */ | 981 | /* Get CPU number */ |
982 | unsigned n = xatoi_u(t); | 982 | unsigned n = xatoi_positive(t); |
983 | if (n >= G.cpu_nr) | 983 | if (n >= G.cpu_nr) |
984 | bb_error_msg_and_die("not that many processors"); | 984 | bb_error_msg_and_die("not that many processors"); |
985 | n++; | 985 | n++; |
diff --git a/procps/nmeter.c b/procps/nmeter.c index bb1e819a6..930585695 100644 --- a/procps/nmeter.c +++ b/procps/nmeter.c | |||
@@ -422,7 +422,7 @@ static s_stat* init_int(const char *param) | |||
422 | if (param[0] == '\0') { | 422 | if (param[0] == '\0') { |
423 | s->no = 1; | 423 | s->no = 1; |
424 | } else { | 424 | } else { |
425 | int n = xatoi_u(param); | 425 | int n = xatoi_positive(param); |
426 | s->no = n + 2; | 426 | s->no = n + 2; |
427 | } | 427 | } |
428 | return (s_stat*)s; | 428 | return (s_stat*)s; |
diff --git a/runit/svlogd.c b/runit/svlogd.c index 9fe81b900..1f0a77cc2 100644 --- a/runit/svlogd.c +++ b/runit/svlogd.c | |||
@@ -688,10 +688,10 @@ static NOINLINE unsigned logdir_open(struct logdir *ld, const char *fn) | |||
688 | break; | 688 | break; |
689 | } | 689 | } |
690 | case 'n': | 690 | case 'n': |
691 | ld->nmax = xatoi_u(&s[1]); | 691 | ld->nmax = xatoi_positive(&s[1]); |
692 | break; | 692 | break; |
693 | case 'N': | 693 | case 'N': |
694 | ld->nmin = xatoi_u(&s[1]); | 694 | ld->nmin = xatoi_positive(&s[1]); |
695 | break; | 695 | break; |
696 | case 't': { | 696 | case 't': { |
697 | static const struct suffix_mult mh_suffixes[] = { | 697 | static const struct suffix_mult mh_suffixes[] = { |
@@ -981,7 +981,7 @@ int svlogd_main(int argc, char **argv) | |||
981 | linemax = 256; | 981 | linemax = 256; |
982 | } | 982 | } |
983 | ////if (opt & 8) { // -b | 983 | ////if (opt & 8) { // -b |
984 | //// buflen = xatoi_u(b); | 984 | //// buflen = xatoi_positive(b); |
985 | //// if (buflen == 0) buflen = 1024; | 985 | //// if (buflen == 0) buflen = 1024; |
986 | ////} | 986 | ////} |
987 | //if (opt & 0x10) timestamp++; // -t | 987 | //if (opt & 0x10) timestamp++; // -t |
diff --git a/shell/hush.c b/shell/hush.c index 0a420f685..df4058998 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -2788,7 +2788,7 @@ static NOINLINE int expand_vars_to_list(o_string *output, int n, char *arg, char | |||
2788 | /* lookup the variable in question */ | 2788 | /* lookup the variable in question */ |
2789 | if (isdigit(var[0])) { | 2789 | if (isdigit(var[0])) { |
2790 | /* parse_dollar() should have vetted var for us */ | 2790 | /* parse_dollar() should have vetted var for us */ |
2791 | i = xatoi_u(var); | 2791 | i = xatoi_positive(var); |
2792 | if (i < G.global_argc) | 2792 | if (i < G.global_argc) |
2793 | val = G.global_argv[i]; | 2793 | val = G.global_argv[i]; |
2794 | /* else val remains NULL: $N with too big N */ | 2794 | /* else val remains NULL: $N with too big N */ |
diff --git a/util-linux/flock.c b/util-linux/flock.c index 78b1e4ba3..be3d552fa 100644 --- a/util-linux/flock.c +++ b/util-linux/flock.c | |||
@@ -40,7 +40,7 @@ int flock_main(int argc UNUSED_PARAM, char **argv) | |||
40 | bb_perror_msg_and_die("can't open '%s'", argv[0]); | 40 | bb_perror_msg_and_die("can't open '%s'", argv[0]); |
41 | //TODO? close_on_exec_on(fd); | 41 | //TODO? close_on_exec_on(fd); |
42 | } else { | 42 | } else { |
43 | fd = xatoi_u(argv[0]); | 43 | fd = xatoi_positive(argv[0]); |
44 | } | 44 | } |
45 | argv++; | 45 | argv++; |
46 | 46 | ||
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c index 2eb5e57ae..7b89e6fdc 100644 --- a/util-linux/hexdump.c +++ b/util-linux/hexdump.c | |||
@@ -90,7 +90,7 @@ int hexdump_main(int argc, char **argv) | |||
90 | bb_dump_addfile(dumper, optarg); | 90 | bb_dump_addfile(dumper, optarg); |
91 | } /* else */ | 91 | } /* else */ |
92 | if (ch == 'n') { | 92 | if (ch == 'n') { |
93 | dumper->dump_length = xatoi_u(optarg); | 93 | dumper->dump_length = xatoi_positive(optarg); |
94 | } /* else */ | 94 | } /* else */ |
95 | if (ch == 's') { /* compat: -s accepts hex numbers too */ | 95 | if (ch == 's') { /* compat: -s accepts hex numbers too */ |
96 | dumper->dump_skip = xstrtoul_range_sfx(optarg, /*base:*/ 0, /*lo:*/ 0, /*hi:*/ LONG_MAX, suffixes); | 96 | dumper->dump_skip = xstrtoul_range_sfx(optarg, /*base:*/ 0, /*lo:*/ 0, /*hi:*/ LONG_MAX, suffixes); |
diff --git a/util-linux/mount.c b/util-linux/mount.c index 9107e4308..aa17872da 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -1147,7 +1147,7 @@ static NOINLINE int nfsmount(struct mntent *mp, long vfsflags, char *filteropts) | |||
1147 | continue; | 1147 | continue; |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | val = xatoi_u(opteq); | 1150 | val = xatoi_positive(opteq); |
1151 | switch (idx) { | 1151 | switch (idx) { |
1152 | case 0: // "rsize" | 1152 | case 0: // "rsize" |
1153 | data.rsize = val; | 1153 | data.rsize = val; |