diff options
author | Karel Zak | 2012-03-30 16:17:36 +0200 |
---|---|---|
committer | Karel Zak | 2012-03-30 16:17:36 +0200 |
commit | 3c2662d5651bcd8348c85f76b02b65301170ab83 (patch) | |
tree | 87f6b153973fd5c1050136d8742b63553234f03a /misc-utils/blkid.c | |
parent | lib/strutils: add strtosize_or_err, clean up (diff) | |
download | kernel-qcow2-util-linux-3c2662d5651bcd8348c85f76b02b65301170ab83.tar.gz kernel-qcow2-util-linux-3c2662d5651bcd8348c85f76b02b65301170ab83.tar.xz kernel-qcow2-util-linux-3c2662d5651bcd8348c85f76b02b65301170ab83.zip |
blkid: use strtosize_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/blkid.c')
-rw-r--r-- | misc-utils/blkid.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c index 1e8073ede..978661903 100644 --- a/misc-utils/blkid.c +++ b/misc-utils/blkid.c @@ -41,6 +41,8 @@ extern int optind; #include <blkid.h> #include "ismounted.h" + +#define STRTOXX_EXIT_CODE 4 /* strtoxx_or_err() */ #include "strutils.h" const char *progname = "blkid"; @@ -764,10 +766,7 @@ int main(int argc, char **argv) } break; case 'O': - if (strtosize(optarg, &offset)) - fprintf(stderr, - "Invalid offset '%s' specified\n", - optarg); + offset = strtosize_or_err(optarg, "failed to parse offset"); break; case 'p': lowprobe |= LOWPROBE_SUPERBLOCKS; @@ -781,10 +780,7 @@ int main(int argc, char **argv) show[numtag] = NULL; break; case 'S': - if (strtosize(optarg, &size)) - fprintf(stderr, - "Invalid size '%s' specified\n", - optarg); + size = strtosize_or_err(optarg, "failed to parse size"); break; case 't': if (search_type) { |