Re: [PATCH] dmsetup: fix sscanf return check

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

 



On Thu, 23 Aug 2012 14:31:02 +0100
Matthew Booth <mbooth@redhat.com> wrote:

> ---
>  tools/dmsetup.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/dmsetup.c b/tools/dmsetup.c
> index 0ac970f..65d17f8 100644
> --- a/tools/dmsetup.c
> +++ b/tools/dmsetup.c
> @@ -228,8 +228,7 @@ static int _parse_line(struct dm_task *dmt, char
> *buffer, const char *file, if (!*ptr || *ptr == '#')
>  		return 1;
>  
> -	if (sscanf(ptr, "%llu %llu %s %n",
> -		   &start, &size, ttype, &n) < 3) {
> +	if (sscanf(ptr, "%llu %llu %s %n", &start, &size, ttype,
> &n) != 4) { err("Invalid format on line %d of table %s", line, file);
>  		return 0;
>  	}

Ah. For non-coders like myself the purpose of this patch seems to be
clouded in mystery...

-- 
Stay in touch,
Mark van Dijk.                  ,------------------------------------
-------------------------------'            Thu Aug 23 20:00 UTC 2012
Today is Setting Orange, the 16th day of Bureaucracy in the YOLD 3178

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux