aboutsummaryrefslogtreecommitdiff
path: root/coreutils/head.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 /coreutils/head.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 '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 7d5f219d2..060febcf7 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -64,32 +64,30 @@ int head_main(int argc, char **argv)
64 while ((opt = getopt(argc, argv, head_opts)) > 0) { 64 while ((opt = getopt(argc, argv, head_opts)) > 0) {
65 switch (opt) { 65 switch (opt) {
66#if ENABLE_FEATURE_FANCY_HEAD 66#if ENABLE_FEATURE_FANCY_HEAD
67 case 'q': 67 case 'q':
68 header_threshhold = INT_MAX; 68 header_threshhold = INT_MAX;
69 break; 69 break;
70 case 'v': 70 case 'v':
71 header_threshhold = -1; 71 header_threshhold = -1;
72 break; 72 break;
73 case 'c': 73 case 'c':
74 count_bytes = 1; 74 count_bytes = 1;
75 /* fall through */ 75 /* fall through */
76#endif 76#endif
77 case 'n': 77 case 'n':
78 p = optarg; 78 p = optarg;
79#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD 79#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
80 GET_COUNT: 80 GET_COUNT:
81#endif 81#endif
82 82
83#if !ENABLE_FEATURE_FANCY_HEAD 83#if !ENABLE_FEATURE_FANCY_HEAD
84 count = bb_xgetularg10(p); 84 count = xatoul(p);
85#else 85#else
86 count = bb_xgetularg_bnd_sfx(p, 10, 86 count = xatoul_sfx(p, head_suffixes);
87 0, ULONG_MAX,
88 head_suffixes);
89#endif 87#endif
90 break; 88 break;
91 default: 89 default:
92 bb_show_usage(); 90 bb_show_usage();
93 } 91 }
94 } 92 }
95 93