summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <info@metux.net>2024-04-02 17:28:03 +0200
committerPovilas Kanapickas <povilas@radix.lt>2024-10-10 13:56:05 +0000
commitbb9953db3f81bffbfdb60f09ac73b359904118b4 (patch)
tree2560dd28545834e6185f9a8237ff53c8cd884ce4
parent9446ae487c4033c07ce02e8823a944d7e10cacd1 (diff)
os: utils: fix char signess mismatch
On NetBSD gives warning: In file included from /usr/include/ctype.h:100, from ../include/misc.h:174, from ../os/utils.c:75: ../os/utils.c: In function ‘VerifyDisplayName’: ../os/utils.c:624:23: warning: array subscript has type ‘char’ [-Wchar-subscripts] 624 | if (!isdigit(d[i])) { | ^ ../os/utils.c: In function ‘ProcessCommandLine’: ../os/utils.c:942:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] 942 | if ((i + 1 < argc) && (isdigit(*argv[i + 1]))) | ^ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1455>
-rw-r--r--os/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/utils.c b/os/utils.c
index eb69980ad..b34145b1f 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -437,7 +437,7 @@ VerifyDisplayName(const char *d)
for digits, or exception of :0.0 and similar (two decimal points max)
*/
for (i = 0; i < strlen(d); i++) {
- if (!isdigit(d[i])) {
+ if (!isdigit((unsigned char)d[i])) {
if (d[i] != '.' || period_found)
return 0;
period_found = TRUE;
@@ -753,7 +753,7 @@ ProcessCommandLine(int argc, char *argv[])
else if (strcmp(argv[i], "-terminate") == 0) {
dispatchExceptionAtReset = DE_TERMINATE;
terminateDelay = -1;
- if ((i + 1 < argc) && (isdigit(*argv[i + 1])))
+ if ((i + 1 < argc) && (isdigit((unsigned char)*argv[i + 1])))
terminateDelay = atoi(argv[++i]);
terminateDelay = max(0, terminateDelay);
}