preparatory patch for -Wwrite-strings #2
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 9871740..af16f2c 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -161,7 +161,7 @@
printf(" %s", tok);
tok = strtok(NULL, "\n");
if (!tok)
- tok = "";
+ tok = (char*)"";
/* New-style has commas, or -. If so,
truncate (other fields might follow). */
else if (strchr(tok, ',')) {
@@ -170,9 +170,11 @@
if (tok[strlen(tok)-1] == ',')
tok[strlen(tok)-1] = '\0';
} else if (tok[0] == '-'
- && (tok[1] == '\0' || isspace(tok[1])))
- tok = "";
- printf(" %s", tok);
+ && (tok[1] == '\0' || isspace(tok[1]))
+ ) {
+ tok = (char*)"";
+ }
+ printf(" %s", tok);
}
puts("");
free(line);