Re: [PATCH] fdformat: Add new switches -f/--from, -t/--to, -r/--repair

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

 



Ahoj Karle.

> > > > + if ((unsigned int)track_from > param.track - 1)
> > > > + err(EXIT_FAILURE, _("'from' is out of allowed range\n"));
> > > > + if ((unsigned int)track_to > param.track - 1)
> > > > + err(EXIT_FAILURE, _("'to' is out of allowed range\n"));
> > > > + if (track_from > track_to)
> > > > + err(EXIT_FAILURE, _("'from' is higher than 'to'\n"));
> > > 
> > > The err() adds new line to print out, so the messages above will print
> > > unexpected empty line.
> > 
> > This can be completely removed after the change to strtou32_or_err(),
> > right?
> 
>  I guess you still want to check user's input against the hardware, so check
>  if track_to is smaller than param.track is correct thing. Right?

The comparison with the param.track is done elsewhere as we don't know
the disk parameters during the argument parsing yet.
We get the parameters after finishing the argument parsing.


>  Anyway, \n is unnecessary, errx() does not print error based on
>  errno, err() follows errno.

Sure, this was more of a copy'n'paste error.


>  Thank, it's nice to see we have someone to test fdformat!

Np. Can test any time.
Going to rework the patch.

Thx,
Jaromir.

--
Jaromir Capik
Red Hat Czech, s.r.o.
Software Engineer / Secondary Arch

Email: jcapik@xxxxxxxxxx
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkynova 99/71, 612 45, Brno, Czech Republic
IC: 27690016
--
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