]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
error: Fix typos in argument checking macros
authorPeter Krempa <pkrempa@redhat.com>
Tue, 19 Jun 2012 13:55:28 +0000 (15:55 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 19 Jun 2012 14:16:15 +0000 (16:16 +0200)
Macro virCheckNullArgGoto is supposed to check for NULL argument but
checks non-NULL instead.

Macro virCheckNonNullArgReturn reports error as if the argument should
be NULL when it shouldn't.

src/internal.h

index 1b1598b08e701d7911da1e6affd2bb131adfe536..60be95df801d83361c18afe25af1f17c7787d48f 100644 (file)
 # define virCheckNonNullArgReturn(argname, retval)  \
     do {                                            \
         if (argname == NULL) {                      \
-            virReportInvalidNullArg(argname);       \
+            virReportInvalidNonNullArg(argname);    \
             return retval;                          \
         }                                           \
     } while (0)
 # define virCheckNullArgGoto(argname, label)        \
     do {                                            \
-        if (argname == NULL) {                      \
+        if (argname != NULL) {                      \
             virReportInvalidNullArg(argname);       \
             goto label;                             \
         }                                           \