Module Name:    src
Committed By:   rillig
Date:           Fri Aug 27 18:09:30 UTC 2021

Modified Files:
        src/usr.bin/sockstat: sockstat.c

Log Message:
sockstat: fix undefined behavior when calling ctype functions

lint says: warning: argument to 'function from <ctype.h>' must be cast
to 'unsigned char', not to 'unsigned int' [342]


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/sockstat/sockstat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/sockstat/sockstat.c
diff -u src/usr.bin/sockstat/sockstat.c:1.23 src/usr.bin/sockstat/sockstat.c:1.24
--- src/usr.bin/sockstat/sockstat.c:1.23	Wed Aug 26 22:57:55 2020
+++ src/usr.bin/sockstat/sockstat.c	Fri Aug 27 18:09:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockstat.c,v 1.23 2020/08/26 22:57:55 christos Exp $ */
+/*	$NetBSD: sockstat.c,v 1.24 2021/08/27 18:09:30 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: sockstat.c,v 1.23 2020/08/26 22:57:55 christos Exp $");
+__RCSID("$NetBSD: sockstat.c,v 1.24 2021/08/27 18:09:30 rillig Exp $");
 #endif
 
 #define _KMEMUSER
@@ -275,7 +275,7 @@ get_num(const char *l, const char **s, c
 	long x;
 	char *t;
 
-	while (isdigit((u_int)**e))
+	while (isdigit((unsigned char)**e))
 		(*e)++;
 	if (*s != *e) {
 		errno = 0;

Reply via email to