b816540
From 298058559eac4619ce938dfd38b37f9c2f37dabc Mon Sep 17 00:00:00 2001
b816540
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
b816540
Date: Thu, 6 May 2010 14:14:34 +0200
b816540
Subject: [PATCH] check for both string representation of NULL
b816540
b816540
---
b816540
 lsscsi.c |    7 ++++---
b816540
 1 files changed, 4 insertions(+), 3 deletions(-)
b816540
b816540
diff --git a/lsscsi.c b/lsscsi.c
b816540
index 1e5bb11..a10f3aa 100644
b816540
--- a/lsscsi.c
b816540
+++ b/lsscsi.c
b816540
@@ -2119,7 +2119,8 @@ one_host_entry(const char * dir_name, const char * devname,
b816540
 {
b816540
         char buff[NAME_LEN_MAX];
b816540
         char value[NAME_LEN_MAX];
b816540
-        char * nullname = "<NULL>";
b816540
+        char * nullname1 = "<NULL>";
b816540
+        char * nullname2 = "(null)";
b816540
         unsigned int host_id;
b816540
 
b816540
         if (opts->classic) {
b816540
@@ -2135,13 +2136,13 @@ one_host_entry(const char * dir_name, const char * devname,
b816540
         strcat(buff, "/");
b816540
         strcat(buff, devname);
b816540
         if ((get_value(buff, "proc_name", value, NAME_LEN_MAX)) &&
b816540
-            (strncmp(value, nullname, 6)))
b816540
+            (strncmp(value, nullname1, 6)) && (strncmp(value, nullname2, 6)))
b816540
                 printf("  %-12s  ", value);
b816540
         else if (if_directory_chdir(buff, "device/../driver")) {
b816540
                 char wd[NAME_LEN_MAX];
b816540
 
b816540
                 if (NULL == getcwd(wd, NAME_LEN_MAX))
b816540
-                        printf("  %-12s  ", nullname);
b816540
+                        printf("  %-12s  ", nullname2);
b816540
                 else
b816540
                         printf("  %-12s  ", basename(wd));
b816540
 
b816540
-- 
b816540
1.6.6.1
b816540