Re: [PATCH 2/4] libmultipath: Simplify assemble_map()

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

 



On Tue, 2017-06-13 at 09:33 -0700, Bart Van Assche wrote:
> Introduce a macro for appending formatted text to the output buffer.
> Eliminate the local variables 'shift' and 'freechar'. Move the
> code for freeing a temporary buffer to the end of the function.
> Handle snprintf() conversion errors. This patch avoids that gcc 7
> reports the following warning:
> 
> dmparser.c:137:20: warning: '__builtin_snprintf' output truncated
> before the last format character [-Wformat-truncation=]
>   snprintf(p, 1, "\n");
>                     ^
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx>
> ---
>  libmultipath/dmparser.c | 67 +++++++++++++++++++++++--------------
> ------------
>  1 file changed, 31 insertions(+), 36 deletions(-)
> 

Reviewed-by: Martin Wilck <mwilck@xxxxxxxx>

-- 
Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux