Module Name: src
Committed By: rillig
Date: Sun May 12 19:03:55 UTC 2024
Modified Files:
src/usr.sbin/flashctl: flashctl.c
Log Message:
flashctl: fix lint's strict bool mode with Clang preprocessor
Treating the return value from the <ctype.h> character classification
functions as an 'int' is neither elegant nor idiomatic, but it works for
now.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/flashctl/flashctl.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.sbin/flashctl/flashctl.c
diff -u src/usr.sbin/flashctl/flashctl.c:1.9 src/usr.sbin/flashctl/flashctl.c:1.10
--- src/usr.sbin/flashctl/flashctl.c:1.9 Sun Jan 8 16:01:49 2023
+++ src/usr.sbin/flashctl/flashctl.c Sun May 12 19:03:55 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: flashctl.c,v 1.9 2023/01/08 16:01:49 rillig Exp $ */
+/* $NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $ */
/*-
* Copyright (c) 2010 Department of Software Engineering,
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: flashctl.c,v 1.9 2023/01/08 16:01:49 rillig Exp $");
+__RCSID("$NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $");
#include <sys/ioctl.h>
#include <sys/flashio.h>
@@ -233,11 +233,11 @@ to_intmax(intmax_t *num, const char *str
errno = 0;
if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) {
- if (!isxdigit((unsigned char)str[2]))
+ if (isxdigit((unsigned char)str[2]) == 0)
return EINVAL;
*num = strtoimax(str, &endptr, 16);
} else {
- if (!isdigit((unsigned char)str[0]))
+ if (isdigit((unsigned char)str[0]) == 0)
return EINVAL;
*num = strtoimax(str, &endptr, 10);
}