[PATCH] Fix compiler error in tgtd.c call_program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using a newer version of gcc, we see an error:

tgtd.c:313:14: error: comparison between pointer and zero character
 constant [-Werror=pointer-compare]
   while (pos != '\0')
              ^~
tgtd.c:313:10: note: did you mean to dereference the pointer?
   while (pos != '\0')
          ^
I think gcc is right, so deref pos.

Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 usr/tgtd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/tgtd.c b/usr/tgtd.c
index 19c703d..ae2f489 100644
--- a/usr/tgtd.c
+++ b/usr/tgtd.c
@@ -310,7 +310,7 @@ int call_program(const char *cmd, void (*callback)(void *data, int result),
 	pos = arg;
 	str_spacecpy(&pos, cmd);
 	if (strchr(cmd, ' ')) {
-		while (pos != '\0')
+		while (*pos != '\0')
 			argv[i++] = strsep(&pos, " ");
 	} else
 		argv[i++] = arg;
-- 
2.9.4

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux