str(1): fixed integer overflow

This commit is contained in:
mars 2023-12-24 18:01:15 -07:00 committed by emma
parent e37c981d66
commit 2c716f1881
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270

View File

@ -66,7 +66,7 @@ pass: for(argv += 2, r = 1; *argv != NULL; ++argv)
/* First checks if argv[0][i] is valid ASCII; ctypes(3) /* First checks if argv[0][i] is valid ASCII; ctypes(3)
* don't handle non-ASCII. * don't handle non-ASCII.
* This is bad. */ * This is bad. */
if(argv[0][i] < 0x80 && !ctypes[ctype].f(argv[0][i])) if((unsigned char)argv[0][i] < 0x80 && !ctypes[ctype].f(argv[0][i]))
return 1; return 1;
else else
r = 0; r = 0;