[PATCH 4/6] Remove EMPTY_STR macro

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

 



Another misleadingly named macro.
Deprecate in favor of NULLSTR_STAR.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/util/virlease.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/util/virlease.c b/src/util/virlease.c
index 7c6c37ec9d..93ca72e3af 100644
--- a/src/util/virlease.c
+++ b/src/util/virlease.c
@@ -42,13 +42,6 @@
 #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")));
             }
         }
     }
-- 
2.20.1


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

  Powered by Linux