blockdev: improve arguments parsing (remove atoi)
old version: # blockdev --setfra 4x096 /dev/sdc new version: # blockdev --setfra 4x096 /dev/sdc blockdev: failed to parse command argument: '4x096' Addresses: https://github.com/karelzak/util-linux/issues/1358 Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
22cecf786f
commit
cbfbbc44c4
|
@ -16,6 +16,7 @@
|
|||
#include "blkdev.h"
|
||||
#include "pathnames.h"
|
||||
#include "closestream.h"
|
||||
#include "strutils.h"
|
||||
#include "sysfs.h"
|
||||
|
||||
struct bdc {
|
||||
|
@ -351,7 +352,7 @@ static void do_commands(int fd, char **argv, int d)
|
|||
bdcms[j].name);
|
||||
errtryhelp(EXIT_FAILURE);
|
||||
}
|
||||
iarg = atoi(argv[++i]);
|
||||
iarg = strtos32_or_err(argv[++i], _("failed to parse command argument"));
|
||||
} else
|
||||
iarg = bdcms[j].argval;
|
||||
|
||||
|
|
Loading…
Reference in New Issue