mcstrans: use null character in strings
PATCH 1/1 mcstrans: use null character in strings
Signed-off-by Kalevi Kolttonen <[email protected]>
--- mcstrans/src/mcstrans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mcstrans/src/mcstrans.c +2 -2
@@ -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
Quoted 2 lines · Kalevi Kolttonen
Signed-off-by Kalevi Kolttonen <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Quoted 30 lines
--- mcstrans/src/mcstrans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mcstrans/src/mcstrans.c +2
-3@@ -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