From 4f5737cbf2931903216322d68084206280a210ad Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 21 Apr 2023 15:32:01 +1200 Subject: libcli/security/dom_sid: use (unsigned char) in isdigit() The man page notes: The standards require that the argument c for these functions is either EOF or a value that is representable in the type unsigned char. If the argument c is of type char, it must be cast to unsigned char, as in the following example: Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- libcli/security/dom_sid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libcli/security') diff --git a/libcli/security/dom_sid.c b/libcli/security/dom_sid.c index 89f2daba0cb..52d4454e4e5 100644 --- a/libcli/security/dom_sid.c +++ b/libcli/security/dom_sid.c @@ -145,7 +145,7 @@ bool dom_sid_parse_endp(const char *sidstr,struct dom_sid *sidout, /* Get the revision number. */ p = sidstr + 2; - if (!isdigit(*p)) { + if (!isdigit((unsigned char)*p)) { goto format_error; } @@ -156,7 +156,7 @@ bool dom_sid_parse_endp(const char *sidstr,struct dom_sid *sidout, sidout->sid_rev_num = (uint8_t) conv; q++; - if (!isdigit(*q)) { + if (!isdigit((unsigned char)*q)) { goto format_error; } while (q[0] == '0' && isdigit((unsigned char)q[1])) { @@ -199,7 +199,7 @@ bool dom_sid_parse_endp(const char *sidstr,struct dom_sid *sidout, q++; while (true) { - if (!isdigit(*q)) { + if (!isdigit((unsigned char)*q)) { goto format_error; } while (q[0] == '0' && isdigit((unsigned char)q[1])) { -- cgit v1.2.1