cut 0.5k off mkfs.minix

assorted strtoul fixes (that's what brought me into minix)...
This commit is contained in:
Denis Vlasenko
2006-11-29 18:15:52 +00:00
parent a35c9e91ba
commit c6ce8733dd
5 changed files with 131 additions and 207 deletions

View File

@ -330,13 +330,16 @@ read_maybe_empty(const char *mesg)
static int
read_hex(const struct systypes *sys)
{
unsigned long v;
while (1) {
read_nonempty(_("Hex code (type L to list codes): "));
if (*line_ptr == 'l' || *line_ptr == 'L')
if (*line_ptr == 'l' || *line_ptr == 'L') {
list_types(sys);
else if (isxdigit(*line_ptr)) {
return strtoul(line_ptr, NULL, 16);
continue;
}
v = bb_strtoul(line_ptr, NULL, 16);
if (errno || v > 0xff) continue;
return v;
}
}
#endif /* CONFIG_FEATURE_FDISK_WRITABLE */