[PATCH] do not compare arrays against NULL

Guillem Jover guillem.jover at nokia.com
Fri Feb 13 10:35:55 PST 2009


---
 hald/linux/osspec.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index f75d88a..0b45f82 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -218,11 +218,11 @@ hald_udev_data (GIOChannel *source, GIOCondition condition, gpointer user_data)
 		HAL_INFO (("missing ACTION"));
 		goto invalid;
 	}
-	if (hotplug_event->sysfs.sysfs_path == NULL) {
+	if (hotplug_event->sysfs.sysfs_path[0] == '\0') {
 		HAL_INFO (("missing DEVPATH"));
 		goto invalid;
 	}
-	if (hotplug_event->sysfs.subsystem == NULL) {
+	if (hotplug_event->sysfs.subsystem[0] == '\0') {
 		HAL_INFO (("missing SUSBSYSTEM"));
 		goto invalid;
 	}
@@ -236,7 +236,7 @@ hald_udev_data (GIOChannel *source, GIOCondition condition, gpointer user_data)
 		HAL_INFO (("Temporary workaround: ignoring temporary cryptsetup file"));
 		goto invalid;
 	}
-	if (hotplug_event->sysfs.device_file && (strstr (hotplug_event->sysfs.device_file, "/dm-") != NULL)) {
+	if (strstr (hotplug_event->sysfs.device_file, "/dm-") != NULL) {
 		HAL_DEBUG (("Found a dm-device (%s), mark it", hotplug_event->sysfs.device_file));
 		hotplug_event->sysfs.is_dm_device = TRUE;
 	}
-- 
1.6.0.2



More information about the hal mailing list