Re: [PATCH] hexdump: adjust -s and -n option in the man page [was: hexsyntax.c using strtol on the offset parameter]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 26, 2012 at 11:50:06AM +0200, mail@xxxxxxxxxxxxxxxxxxx wrote:
> 
> On March 26, 2012 at 11:39 AM "mail@xxxxxxxxxxxxxxxxxxx"
> <mail@xxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx>
> Date: Mon, 26 Mar 2012 11:48:57 +0200
> Subject: [PATCH] wipefs: use strtosize() for -o
> Signed-off-by: Bernhard Voelker <mail@xxxxxxxxxxxxxxxxxxx>
> ---
> 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);

 strtoll_offset() uses strtosize() :-)

 Anyway, I'll add strtosize_or_err() to make it more usable in
 argv[] parsers.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux