[PATCH] error: Fix macro checking for NULL arguments

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

 



Macro virCheckNullArgGoto is supposed to check for NULL argument but
checks non-NULL instead.
---
 src/internal.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/internal.h b/src/internal.h
index 1b1598b..b09609e 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -241,21 +241,21 @@

 # define virCheckNonNullArgReturn(argname, retval)  \
     do {                                            \
         if (argname == NULL) {                      \
             virReportInvalidNullArg(argname);       \
             return retval;                          \
         }                                           \
     } while (0)
 # define virCheckNullArgGoto(argname, label)        \
     do {                                            \
-        if (argname == NULL) {                      \
+        if (argname != NULL) {                      \
             virReportInvalidNullArg(argname);       \
             goto label;                             \
         }                                           \
     } while (0)
 # define virCheckNonNullArgGoto(argname, label)     \
     do {                                            \
         if (argname == NULL) {                      \
             virReportInvalidNonNullArg(argname);    \
             goto label;                             \
         }                                           \
-- 
1.7.8.6

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]