strip_unprintable: clarify type conversion

This type conversion is more easily shown to work as intended than the
conversion introduced in 9dcb9e169.
This commit is contained in:
Janik Kleinhoff 2018-10-25 20:31:46 +00:00 committed by Ed Kellett
parent 9dcb9e1696
commit 12b3a184bc
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC

View file

@ -83,9 +83,9 @@ strip_colour(char *string)
static inline char *
strip_unprintable(char *string)
{
unsigned char *c = (unsigned char *)string;
unsigned char *c2 = (unsigned char *)string;
unsigned char *last_non_space = NULL;
char *c = string;
char *c2 = string;
char *last_non_space = NULL;
/* c is source, c2 is target */
for(; c && *c; c++)
@ -109,7 +109,7 @@ strip_unprintable(char *string)
*c2++ = *c;
break;
default:
if (*c < 32)
if ((unsigned char)*c < 32)
break;
*c2++ = *c;
last_non_space = c2;