X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6c42153ad9362cc676ea66563bf400d7511b3b68..2e768e3cc0ce768373d3320eca4cdd08b8cf646a:/sbr/trimcpy.c diff --git a/sbr/trimcpy.c b/sbr/trimcpy.c index c341f00c..3a2fbd76 100644 --- a/sbr/trimcpy.c +++ b/sbr/trimcpy.c @@ -4,8 +4,6 @@ * -- replace internal whitespace with spaces, * -- then return a copy. * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -20,12 +18,12 @@ trimcpy (char *cp) 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; @@ -33,7 +31,7 @@ trimcpy (char *cp) /* replace remaining whitespace with spaces */ for (sp = cp; *sp; sp++) { - if (isspace(*sp)) + if (isspace((unsigned char) *sp)) *sp = ' '; }