Module Name:    src
Committed By:   rillig
Date:           Fri Aug 27 17:41:39 UTC 2021

Modified Files:
        src/usr.bin/sdpquery: print.c

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/sdpquery/print.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/sdpquery/print.c
diff -u src/usr.bin/sdpquery/print.c:1.23 src/usr.bin/sdpquery/print.c:1.24
--- src/usr.bin/sdpquery/print.c:1.23	Thu Oct 24 18:18:00 2019
+++ src/usr.bin/sdpquery/print.c	Fri Aug 27 17:41:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.23 2019/10/24 18:18:00 kamil Exp $	*/
+/*	$NetBSD: print.c,v 1.24 2021/08/27 17:41:39 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: print.c,v 1.23 2019/10/24 18:18:00 kamil Exp $");
+__RCSID("$NetBSD: print.c,v 1.24 2021/08/27 17:41:39 rillig Exp $");
 
 #include <ctype.h>
 #include <iconv.h>
@@ -1059,7 +1059,8 @@ print_language_base_attribute_id_list(sd
 			break;
 
 		be16enc(lang, v);
-		if (!islower((int)lang[0]) || !islower((int)lang[1]))
+		if (!islower((unsigned char)lang[0]) ||
+		    !islower((unsigned char)lang[1]))
 			break;
 
 		/*

Reply via email to