[PATCH 2/8] virTypedParamsValidate: do not use STREQ_NULLABLE

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

 



The field cannot be non-NULL. Only check last_name for NULL to make
clang happy:

util/virtypedparam.c:109:104: error: address of array 'sorted[i].field'
will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

  if (((last_name) ? (sorted[i].field) && (strcmp((last_name)
                                                  ?
                                                  (last_name)
                                                  : "",
                                                  (sorted[i].field)
                                                  ?
                                                  (sorted[i].field)
                                                  : "") == 0)
       : !(sorted[i].field)) &&
---
 src/util/virtypedparam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index 23109e1..6013688 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -106,7 +106,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
         if (STRNEQ(sorted[i].field, keys[j].field)) {
             j++;
         } else {
-            if (STREQ_NULLABLE(last_name, sorted[i].field) &&
+            if (last_name && STREQ(last_name, sorted[i].field) &&
                 !(keys[j].value.i & VIR_TYPED_PARAM_MULTIPLE)) {
                 virReportError(VIR_ERR_INVALID_ARG,
                                _("parameter '%s' occurs multiple times"),
-- 
2.7.3

--
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]