[libvirt] [PATCH] Fix more printf("%s", NULL) usage

Jim Meyering jim at meyering.net
Mon Feb 2 18:17:29 UTC 2009


john.levon at sun.com wrote:
> diff --git a/src/libvirt.c b/src/libvirt.c
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -2871,7 +2871,9 @@ virDomainMigratePrepare (virConnectPtr d
>                             const char *dname,
>                             unsigned long bandwidth)
>  {
> -    DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, uri_in, uri_out, flags, dname, bandwidth);
> +    VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, "
> +        "flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen,
> +        NULLSTR(uri_in), uri_out, flags, NULLSTR(dname), bandwidth);
>
>      virResetLastError();

ACK.

Limited-width side-by-side comparators thank you for
splitting the long lines.

Thought note that we like continuation lines
to be aligned with the opening parenthesis, i.e.,

    VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, "
              "flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen,
              NULLSTR(uri_in), uri_out, flags, NULLSTR(dname), bandwidth);

because that's what most automatic indenters do.




More information about the libvir-list mailing list