aboutsummaryrefslogtreecommitdiff
path: root/coreutils/head.c
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-08 12:49:22 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-08 12:49:22 +0000
commit87d25a2b8535dc627a02eb539fa3946be2a24647 (patch)
treefc4d14a910593d1235318bb36abe5e9f72d2039e /coreutils/head.c
parent81177b14907e73f11560f69e0b4ec34371f1a7d5 (diff)
downloadbusybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.tar.gz
busybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.tar.bz2
busybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.zip
attempt to regularize atoi mess.
git-svn-id: svn://busybox.net/trunk/busybox@16342 69ca8d6d-28ef-0310-b511-8ec308f3f277
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