From 0284c44519bdd7850a5d1d4dec0fcf24f71b24e1 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 4 Nov 1999 04:16:28 +0000 Subject: Add unsigned char cast to isspace arg --- lib/libc/gen/getcap.c | 4 +++- lib/libc/gen/getnetgrent.c | 8 +++++--- lib/libc/gen/getttyent.c | 6 ++++-- lib/libc/gen/getusershell.c | 4 +++- 4 files changed, 15 insertions(+), 7 deletions(-) (limited to 'lib/libc/gen') diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index 90fbd18..d1e33b4 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -32,6 +32,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -682,7 +684,7 @@ cgetnext(bp, db_array) slash = 0; continue; } - if (isspace(*line) || + if (isspace((unsigned char)*line) || *line == ':' || *line == '#' || slash) { if (line[len - 2] == '\\') slash = 1; diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index cc33d1f..a26c86c 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -32,6 +32,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -283,16 +285,16 @@ static int _listmatch(list, group, len) int glen = strlen(group); /* skip possible leading whitespace */ - while(isspace(*ptr)) + while(isspace((unsigned char)*ptr)) ptr++; while (ptr < list + len) { cptr = ptr; - while(*ptr != ',' && *ptr != '\0' && !isspace(*ptr)) + while(*ptr != ',' && *ptr != '\0' && !isspace((unsigned char)*ptr)) ptr++; if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr)) return(1); - while(*ptr == ',' || isspace(*ptr)) + while(*ptr == ',' || isspace((unsigned char)*ptr)) ptr++; } diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index ac3e138..bfbe833 100644 --- a/lib/libc/gen/getttyent.c +++ b/lib/libc/gen/getttyent.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -92,13 +94,13 @@ getttyent() if (!fgets(&line[i], lbsize - i, tf)) return (NULL); } - while (isspace(*p)) + while (isspace((unsigned char)*p)) ++p; if (*p && *p != '#') break; } -#define scmp(e) !strncmp(p, e, sizeof(e) - 1) && isspace(p[sizeof(e) - 1]) +#define scmp(e) !strncmp(p, e, sizeof(e) - 1) && isspace((unsigned char)p[sizeof(e) - 1]) #define vcmp(e) !strncmp(p, e, sizeof(e) - 1) && p[sizeof(e) - 1] == '=' zapchar = 0; diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c index 408f9f3..be1a77a 100644 --- a/lib/libc/gen/getusershell.c +++ b/lib/libc/gen/getusershell.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -127,7 +129,7 @@ initshells() if (*cp == '#' || *cp == '\0') continue; *sp++ = cp; - while (!isspace(*cp) && *cp != '#' && *cp != '\0') + while (!isspace((unsigned char)*cp) && *cp != '#' && *cp != '\0') cp++; *cp++ = '\0'; } -- cgit v1.1