summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <git@arunraghavan.net>2015-04-13 08:34:54 +0530
committerArun Raghavan <git@arunraghavan.net>2015-04-13 08:35:53 +0530
commit3f0ab4522a6bf77667e3d253755ac5217fbe921a (patch)
tree44bb35e0b0aea01d7375dcb85ef8c18bf45d9313
parent492fa1ff32ed95d13310ff3b3003564a2a16a06d (diff)
udev: Deal with unavailable bus property
Fixes a compiler warning: ../../src/modules/udev-util.c: In function 'pa_udev_get_info': ../../src/modules/udev-util.c:228:443: warning: 'bus' may be used uninitialized in this function [-Wmaybe-uninitialized] if (!pa_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
-rw-r--r--src/modules/udev-util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c
index d32f8d753..026493be0 100644
--- a/src/modules/udev-util.c
+++ b/src/modules/udev-util.c
@@ -168,7 +168,7 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
struct udev_device *card = NULL;
char *t;
const char *v;
- const char *bus;
+ const char *bus = NULL;
int id;
pa_assert(p);
@@ -211,7 +211,7 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
if (!pa_proplist_contains(p, PA_PROP_DEVICE_VENDOR_NAME)) {
/* ID_VENDOR_FROM_DATABASE returns the name of IEEE 1394 Phy/Link chipset for FireWire devices */
- if (!pa_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_VENDOR_FROM_DATABASE")) && *v)
+ if (!pa_safe_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_VENDOR_FROM_DATABASE")) && *v)
pa_proplist_sets(p, PA_PROP_DEVICE_VENDOR_NAME, v);
else if ((v = udev_device_get_property_value(card, "ID_VENDOR_ENC")) && *v)
proplist_sets_unescape(p, PA_PROP_DEVICE_VENDOR_NAME, v);
@@ -225,7 +225,7 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
if (!pa_proplist_contains(p, PA_PROP_DEVICE_PRODUCT_NAME)) {
/* ID_MODEL_FROM_DATABASE returns the name of IEEE 1394 Phy/Link chipset for FireWire devices */
- if (!pa_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
+ if (!pa_safe_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
pa_proplist_sets(p, PA_PROP_DEVICE_PRODUCT_NAME, v);
else if ((v = udev_device_get_property_value(card, "ID_MODEL_ENC")) && *v)
proplist_sets_unescape(p, PA_PROP_DEVICE_PRODUCT_NAME, v);