X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5dd6771b28c257af405d7248639ed0e3bcdce38b..e0e0c1e0fce54f31e8b126d78a0b364208f7d36f:/sbr/trimcpy.c diff --git a/sbr/trimcpy.c b/sbr/trimcpy.c index b640ea6f..3a2fbd76 100644 --- a/sbr/trimcpy.c +++ b/sbr/trimcpy.c @@ -13,17 +13,17 @@ char * -trimcpy (unsigned char *cp) +trimcpy (char *cp) { - unsigned char *sp; + char *sp; /* skip over leading whitespace */ - while (isspace(*cp)) + while (isspace((unsigned char) *cp)) cp++; /* start at the end and zap trailing whitespace */ for (sp = cp + strlen(cp) - 1; sp >= cp; sp--) { - if (isspace(*sp)) + if (isspace((unsigned char) *sp)) *sp = '\0'; else break; @@ -31,7 +31,7 @@ trimcpy (unsigned char *cp) /* replace remaining whitespace with spaces */ for (sp = cp; *sp; sp++) { - if (isspace(*sp)) + if (isspace((unsigned char) *sp)) *sp = ' '; }