Skip to contentSkip to conversation

mcstrans: use null character in strings

PATCH In review Kalevi Kolttonen 2 participants 2 messages Jun 14 – Jun 15 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mcstrans: use null character in strings

---
 mcstrans/src/mcstrans.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mcstrans/src/mcstrans.c +2 -2
index ee9392bc..c494e76e 100644
@@ -717,7 +717,7 @@ static char *trim(char *str, const char *whitespace)
 	char *p = str + strlen(str);
 
 	while (p > str && strchr(whitespace, *(p - 1)) != NULL)
-		*--p = 0;
+		*--p = '\0';
 	return str;
 }
 
@@ -793,7 +793,7 @@ static int process_trans(char *buffer)
 	/* zap trailing whitespace */
 	buffer = trim(buffer, "\t \r\n");
 
-	if (*buffer == 0)
+	if (*buffer == '\0')
 		return 0;
 
 	char *delim = strpbrk(buffer, "=!>");
Signature · 1 line
2.54.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Kalevi Kolttonen
Quoted 30 lines
---
 mcstrans/src/mcstrans.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mcstrans/src/mcstrans.c +2 -3
index ee9392bc..c494e76e 100644
@@ -717,7 +717,7 @@ static char *trim(char *str, const char *whitespace)
        char *p = str + strlen(str);
 
        while (p > str && strchr(whitespace, *(p - 1)) != NULL)
-               *--p = 0;
+               *--p = '\0';
        return str;
 }
 
@@ -793,7 +793,7 @@ static int process_trans(char *buffer)
        /* zap trailing whitespace */
        buffer = trim(buffer, "\t \r\n");
 
-       if (*buffer == 0)
+       if (*buffer == '\0')
                return 0;
 
        char *delim = strpbrk(buffer, "=!>");
--

2.54.0