summaryrefslogtreecommitdiff
path: root/coreutils/head.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-08 12:49:22 +0000
committerDenis Vlasenko2006-10-08 12:49:22 +0000
commit1385899416a4396385ad421ae1f532be7103738a (patch)
treefc4d14a910593d1235318bb36abe5e9f72d2039e /coreutils/head.c
parent5625415085e68ac5e150f54e685417c866620d76 (diff)
downloadbusybox-1385899416a4396385ad421ae1f532be7103738a.zip
busybox-1385899416a4396385ad421ae1f532be7103738a.tar.gz
attempt to regularize atoi mess.
Diffstat (limited to 'coreutils/head.c')
-rw-r--r--coreutils/head.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/coreutils/head.c b/coreutils/head.c
index 7d5f219..060febc 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -64,32 +64,30 @@ int head_main(int argc, char **argv)
while ((opt = getopt(argc, argv, head_opts)) > 0) {
switch (opt) {
#if ENABLE_FEATURE_FANCY_HEAD
- case 'q':
- header_threshhold = INT_MAX;
- break;
- case 'v':
- header_threshhold = -1;
- break;
- case 'c':
- count_bytes = 1;
- /* fall through */
+ case 'q':
+ header_threshhold = INT_MAX;
+ break;
+ case 'v':
+ header_threshhold = -1;
+ break;
+ case 'c':
+ count_bytes = 1;
+ /* fall through */
#endif
- case 'n':
- p = optarg;
+ case 'n':
+ p = optarg;
#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
- GET_COUNT:
+ GET_COUNT:
#endif
#if !ENABLE_FEATURE_FANCY_HEAD
- count = bb_xgetularg10(p);
+ count = xatoul(p);
#else
- count = bb_xgetularg_bnd_sfx(p, 10,
- 0, ULONG_MAX,
- head_suffixes);
+ count = xatoul_sfx(p, head_suffixes);
#endif
- break;
- default:
- bb_show_usage();
+ break;
+ default:
+ bb_show_usage();
}
}