[PATCH 06/10] mtd-utils: nandwrite: Use 64-bit offset
Artem Bityutskiy
dedekind1 at gmail.com
Sun Nov 14 02:49:10 EST 2010
On Sat, 2010-11-13 at 17:45 -0500, Mike Frysinger wrote:
> On Sat, Nov 13, 2010 at 06:48, Artem Bityutskiy wrote:
> > On Wed, 2010-11-03 at 01:27 -0700, Brian Norris wrote:
> >> - mtdoffset = strtol(optarg, NULL, 0);
> >> + mtdoffset = strtoll(optarg, NULL, 0);
> >
> > Ideally this should check for strtoll failures, but this just a side
> > note. Not sure if this is the best way, but I'd do it like this:
> >
> > char *endp;
> >
> > mtdoffset = strtoul(optarg, &endp, 0);
> > if (*endp != '\0' || endp == optarg)
> > return errmsg("bad volume alignment: \"%s\"", optarg);
> >
> > or something like this. The check for negative mtdoffset could be there
> > as well.
>
> or use simple_strtoll() from common.h as that includes error handling ...
Oh, even better.
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
More information about the linux-mtd
mailing list