From: "mail@bernhard-voelker.de" <mail@bernhard-voelker.de>
To: Karel Zak <kzak@redhat.com>
Cc: Simon de Vlieger <simon@ikanobori.jp>,
"util-linux@vger.kernel.org" <util-linux@vger.kernel.org>
Subject: Re: [PATCH] hexdump: adjust -s and -n option in the man page [was: hexsyntax.c using strtol on the offset parameter]
Date: Mon, 26 Mar 2012 11:50:06 +0200 (CEST) [thread overview]
Message-ID: <1832206888.202754.1332755406928.JavaMail.open-xchange@email.1und1.de> (raw)
In-Reply-To: <1961842217.201279.1332754786305.JavaMail.open-xchange@email.1und1.de>
On March 26, 2012 at 11:39 AM "mail@bernhard-voelker.de"
<mail@bernhard-voelker.de> wrote:
> * [PATCH 1/2] wipefs: use strtosize() for -o
oops, sorry, there is an error in that patch.
It was obviously not so trivial as at seemed to be.
Here's the correction.
Berny
>From 531cb1ec623fc5c3ac0e95f897b712517b5b1167 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Mon, 26 Mar 2012 11:48:57 +0200
Subject: [PATCH] wipefs: use strtosize() for -o
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
---
misc-utils/wipefs.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index 74de3a3..5059c7c 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -385,6 +385,7 @@ main(int argc, char **argv)
{
struct wipe_desc *wp0 = NULL, *wp;
int c, all = 0, has_offset = 0, noact = 0, mode = 0, quiet = 0;
+ uintmax_t offset;
static const struct option longopts[] = {
{ "all", 0, 0, 'a' },
@@ -414,7 +415,10 @@ main(int argc, char **argv)
noact++;
break;
case 'o':
- wp0 = add_offset(wp0, strtoll_offset(optarg), 1);
+ if (strtosize(optarg, &offset))
+ errx(EXIT_FAILURE,
+ _("invalid offset '%s' specified"), optarg);
+ wp0 = add_offset(wp0, offset, 1);
has_offset++;
break;
case 'p':
--
1.7.9
next prev parent reply other threads:[~2012-03-26 9:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 11:58 [PATCH] hexdump: adjust -s and -n option in the man page [was: hexsyntax.c using strtol on the offset parameter] Bernhard Voelker
2012-03-23 17:19 ` Karel Zak
2012-03-26 7:20 ` mail
2012-03-26 8:41 ` Karel Zak
2012-03-26 9:39 ` mail
2012-03-26 9:50 ` mail [this message]
2012-03-30 13:34 ` Karel Zak
2012-03-30 13:26 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1832206888.202754.1332755406928.JavaMail.open-xchange@email.1und1.de \
--to=mail@bernhard-voelker.de \
--cc=kzak@redhat.com \
--cc=simon@ikanobori.jp \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox