aboutsummaryrefslogtreecommitdiff
path: root/util-linux/dmesg.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-08 12:49:22 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-08 12:49:22 +0000
commit1385899416a4396385ad421ae1f532be7103738a (patch)
treefc4d14a910593d1235318bb36abe5e9f72d2039e /util-linux/dmesg.c
parent5625415085e68ac5e150f54e685417c866620d76 (diff)
downloadbusybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.gz
busybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.bz2
busybox-w32-1385899416a4396385ad421ae1f532be7103738a.zip
attempt to regularize atoi mess.
Diffstat (limited to 'util-linux/dmesg.c')
-rw-r--r--util-linux/dmesg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 277415a2d..658cddc38 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -19,13 +19,13 @@ int dmesg_main(int argc, char *argv[])
19 int flags = getopt32(argc, argv, "cs:n:", &size, &level); 19 int flags = getopt32(argc, argv, "cs:n:", &size, &level);
20 20
21 if (flags & 4) { 21 if (flags & 4) {
22 if (klogctl(8, NULL, bb_xgetlarg(level, 10, 0, 10))) 22 if (klogctl(8, NULL, xatoul_range(level, 0, 10)))
23 bb_perror_msg_and_die("klogctl"); 23 bb_perror_msg_and_die("klogctl");
24 } else { 24 } else {
25 int len; 25 int len;
26 char *buf; 26 char *buf;
27 27
28 len = (flags & 2) ? bb_xgetlarg(size, 10, 2, INT_MAX) : 16384; 28 len = (flags & 2) ? xatoul_range(size, 2, INT_MAX) : 16384;
29 buf = xmalloc(len); 29 buf = xmalloc(len);
30 if (0 > (len = klogctl(3 + (flags & 1), buf, len))) 30 if (0 > (len = klogctl(3 + (flags & 1), buf, len)))
31 bb_perror_msg_and_die("klogctl"); 31 bb_perror_msg_and_die("klogctl");