[libvirt] [PATCH 1/2] maint: Change the text of the NULLSTR() macro to "<null>"

Eric Blake eblake at redhat.com
Wed Feb 5 18:39:31 UTC 2014


On 02/05/2014 10:44 AM, Peter Krempa wrote:
> Eric Blake suggested to change this message to be different from the
> glibc's NULL deref protection message in printf to be able to
> differentiate errors.
> ---
>  src/internal.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK (although I'm probably biased) - that way, if we see "<null>" in a
message, we know we are safe; if we see "(null)" in a message, we know
we have a NULL deref bug to fix.

> 
> diff --git a/src/internal.h b/src/internal.h
> index 4ba0e41..cef3da0 100644
> --- a/src/internal.h
> +++ b/src/internal.h
> @@ -244,7 +244,7 @@
>  /*
>   * Use this when passing possibly-NULL strings to printf-a-likes.
>   */
> -# define NULLSTR(s) ((s) ? (s) : "(null)")
> +# define NULLSTR(s) ((s) ? (s) : "<null>")
> 
>  /**
>   * TODO:
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140205/9b4be9ad/attachment-0001.sig>


More information about the libvir-list mailing list