[Libguestfs] [PATCH supermin 2/3] init: Move variable declarations to the top of the function.

Pino Toscano ptoscano at redhat.com
Thu Apr 20 12:15:26 UTC 2017


On Wednesday, 19 April 2017 11:57:27 CEST Richard W.M. Jones wrote:
> No functional change, just change the style to the one used
> by libguestfs.
> ---

Mostly LGTM.

>    while (fgets (line, sizeof line, fp)) {
> -    size_t n = strlen (line);
> +    n = strlen (line);

This one I would leave -- as it avoids using a wrong/nonsense value
outside of the loop, and at the same time making sure it is properly
reset every time.

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170420/08dbe0f7/attachment.sig>


More information about the Libguestfs mailing list