When HAL returns a NULL property, print "(null)" instead of a NULL pointer

They've promised to fix Solaris printf soon to check for NULL pointers
instead of segfaulting, but that won't help people on existing releases.
This commit is contained in:
Alan Coopersmith 2008-11-05 21:58:04 -08:00
parent 13d06f5aaf
commit b4ca9dc239

View File

@ -120,7 +120,7 @@ get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name)
char *prop, *ret;
prop = libhal_device_get_property_string(hal_ctx, udi, name, NULL);
LogMessageVerb(X_INFO, 10, "config/hal: getting %s on %s returned %s\n", name, udi, prop);
LogMessageVerb(X_INFO, 10, "config/hal: getting %s on %s returned %s\n", name, udi, prop ? prop : "(null)");
if (prop) {
ret = xstrdup(prop);
libhal_free_string(prop);