Re: [PATCH 1/8] fdisk: make CHS user values more robust

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

 



On Mon, Apr 16, 2012 at 11:44:33AM +0200, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@xxxxxxx>
> 
> Signed-off-by: Davidlohr Bueso <dave@xxxxxxx>
> ---
>  fdisk/cfdisk.c |    6 +++---
>  fdisk/fdisk.c  |    8 ++++----
>  fdisk/sfdisk.c |    9 +++++----
>  3 files changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
> index a6cf01e..33624bb 100644
> --- a/fdisk/cfdisk.c
> +++ b/fdisk/cfdisk.c
> @@ -2776,7 +2776,7 @@ main(int argc, char **argv)
>  	    arrow_cursor = TRUE;
>  	    break;
>  	case 'c':
> -	    user_cylinders = cylinders = atoll(optarg);
> +		user_cylinders = cylinders = strtoll_or_err(optarg, _("cannot parse amount of cylinders"));

s/amount/number ?

dtto below

>  	    if (cylinders <= 0) {
>  		fprintf(stderr, "%s: %s\n", argv[0], _("Illegal cylinders value"));
>  		exit(1);
> @@ -2786,14 +2786,14 @@ main(int argc, char **argv)
>  	    use_partition_table_geometry = TRUE;
>  	    break;
>  	case 'h':
> -	    user_heads = heads = atoi(optarg);
> +	    user_heads = heads = strtol_or_err(optarg, _("cannot parse amount of heads"));

[SNIP]

--
Petr Uzel
IRC: ptr_uzl @ freenode

Attachment: pgpFNNHwY6BWG.pgp
Description: PGP signature


[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