[BACK]Return to patch-lib_sysfs.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / devel / libuuid / patches

File: [cvs.NetBSD.org] / pkgsrc / devel / libuuid / patches / patch-lib_sysfs.c (download)

Revision 1.1, Sat Apr 2 21:00:54 2022 UTC (10 months ago) by riastradh
Branch: MAIN
CVS Tags: pkgsrc-2022Q4-base, pkgsrc-2022Q4, pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, HEAD

devel/libuuid: Patch ctype(3) abuse.

$NetBSD: patch-lib_sysfs.c,v 1.1 2022/04/02 21:00:54 riastradh Exp $

Fix ctype(3) abuse.

--- lib/sysfs.c.orig	2018-07-11 13:34:54.228003727 +0000
+++ lib/sysfs.c
@@ -346,8 +346,9 @@ int sysfs_is_partition_dirent(DIR *dir, 
 		 *	"<parent>[:digit:]" or "<parent>p[:digit:]"
 		 */
 		return strncmp(p, d->d_name, len) == 0 &&
-		       ((*(d->d_name + len) == 'p' && isdigit(*(d->d_name + len + 1)))
-			|| isdigit(*(d->d_name + len)));
+		       ((*(d->d_name + len) == 'p' &&
+			   isdigit((unsigned char)*(d->d_name + len + 1)))
+			|| isdigit((unsigned char)*(d->d_name + len)));
 	}
 
 	/* Cannot use /partition file, not supported on old sysfs */