wipefs: use strtosize_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
3c2662d565
commit
99727496ed
|
@ -346,16 +346,6 @@ do_wipe(struct wipe_desc *wp, const char *devname, int noact, int all, int quiet
|
||||||
return wp;
|
return wp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static loff_t
|
|
||||||
strtoll_offset(const char *str)
|
|
||||||
{
|
|
||||||
uintmax_t sz;
|
|
||||||
|
|
||||||
if (strtosize(str, &sz))
|
|
||||||
errx(EXIT_FAILURE, _("invalid offset value '%s' specified"), str);
|
|
||||||
return sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void __attribute__((__noreturn__))
|
static void __attribute__((__noreturn__))
|
||||||
usage(FILE *out)
|
usage(FILE *out)
|
||||||
|
@ -414,7 +404,8 @@ main(int argc, char **argv)
|
||||||
noact++;
|
noact++;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
wp0 = add_offset(wp0, strtoll_offset(optarg), 1);
|
wp0 = add_offset(wp0, strtosize_or_err(optarg,
|
||||||
|
_("failed to parse offset")), 1);
|
||||||
has_offset++;
|
has_offset++;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
|
|
Loading…
Reference in New Issue