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:
parent
13d06f5aaf
commit
b4ca9dc239
|
@ -120,7 +120,7 @@ get_prop_string(LibHalContext *hal_ctx, const char *udi, const char *name)
|
||||||
char *prop, *ret;
|
char *prop, *ret;
|
||||||
|
|
||||||
prop = libhal_device_get_property_string(hal_ctx, udi, name, NULL);
|
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) {
|
if (prop) {
|
||||||
ret = xstrdup(prop);
|
ret = xstrdup(prop);
|
||||||
libhal_free_string(prop);
|
libhal_free_string(prop);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user