diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-29 18:15:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-29 18:15:52 +0000 |
commit | c6ce8733dda7e6f9146e0a040048aebea0c2e589 (patch) | |
tree | fb5fd16229f7c9f34423c4f27ed47cc19e7434df /util-linux/fdisk.c | |
parent | a35c9e91ba53073ff797d1d68d0d4e1836d934f0 (diff) | |
download | busybox-w32-c6ce8733dda7e6f9146e0a040048aebea0c2e589.tar.gz busybox-w32-c6ce8733dda7e6f9146e0a040048aebea0c2e589.tar.bz2 busybox-w32-c6ce8733dda7e6f9146e0a040048aebea0c2e589.zip |
cut 0.5k off mkfs.minix
assorted strtoul fixes (that's what brought me into minix)...
Diffstat (limited to 'util-linux/fdisk.c')
-rw-r--r-- | util-linux/fdisk.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index c226d6a00..2f87f1c60 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -330,13 +330,16 @@ read_maybe_empty(const char *mesg) | |||
330 | static int | 330 | static int |
331 | read_hex(const struct systypes *sys) | 331 | read_hex(const struct systypes *sys) |
332 | { | 332 | { |
333 | unsigned long v; | ||
333 | while (1) { | 334 | while (1) { |
334 | read_nonempty(_("Hex code (type L to list codes): ")); | 335 | read_nonempty(_("Hex code (type L to list codes): ")); |
335 | if (*line_ptr == 'l' || *line_ptr == 'L') | 336 | if (*line_ptr == 'l' || *line_ptr == 'L') { |
336 | list_types(sys); | 337 | list_types(sys); |
337 | else if (isxdigit(*line_ptr)) { | 338 | continue; |
338 | return strtoul(line_ptr, NULL, 16); | ||
339 | } | 339 | } |
340 | v = bb_strtoul(line_ptr, NULL, 16); | ||
341 | if (errno || v > 0xff) continue; | ||
342 | return v; | ||
340 | } | 343 | } |
341 | } | 344 | } |
342 | #endif /* CONFIG_FEATURE_FDISK_WRITABLE */ | 345 | #endif /* CONFIG_FEATURE_FDISK_WRITABLE */ |