]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove EMPTY_STR macro
authorJán Tomko <jtomko@redhat.com>
Tue, 12 Feb 2019 16:15:17 +0000 (17:15 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 14 Feb 2019 13:09:38 +0000 (14:09 +0100)
Another misleadingly named macro.
Deprecate in favor of NULLSTR_STAR.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/util/virlease.c

index 7c6c37ec9d6eda2c7f92755cd3ceb543418a2f3d..93ca72e3af2f4c872df53c362582761d78127f6e 100644 (file)
 #define VIR_NETWORK_DHCP_LEASE_FILE_SIZE_MAX (32 * 1024 * 1024)
 
 
-/*
- * Use this when passing possibly-NULL strings to printf-a-likes.
- * Required for unknown parameters during init call.
- */
-#define EMPTY_STR(s) ((s) ? (s) : "*")
-
-
 int
 virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new,
                             const char *custom_lease_file,
@@ -176,8 +169,8 @@ virLeasePrintLeases(virJSONValuePtr leases_array_new,
                    expirytime,
                    virJSONValueObjectGetString(lease_tmp, "mac-address"),
                    virJSONValueObjectGetString(lease_tmp, "ip-address"),
-                   EMPTY_STR(virJSONValueObjectGetString(lease_tmp, "hostname")),
-                   EMPTY_STR(virJSONValueObjectGetString(lease_tmp, "client-id")));
+                   NULLSTR_STAR(virJSONValueObjectGetString(lease_tmp, "hostname")),
+                   NULLSTR_STAR(virJSONValueObjectGetString(lease_tmp, "client-id")));
         }
     }
 
@@ -200,8 +193,8 @@ virLeasePrintLeases(virJSONValuePtr leases_array_new,
                        expirytime,
                        virJSONValueObjectGetString(lease_tmp, "iaid"),
                        virJSONValueObjectGetString(lease_tmp, "ip-address"),
-                       EMPTY_STR(virJSONValueObjectGetString(lease_tmp, "hostname")),
-                       EMPTY_STR(virJSONValueObjectGetString(lease_tmp, "client-id")));
+                       NULLSTR_STAR(virJSONValueObjectGetString(lease_tmp, "hostname")),
+                       NULLSTR_STAR(virJSONValueObjectGetString(lease_tmp, "client-id")));
             }
         }
     }