ctype: test and fix character conversion functions (DONE)

Some shenanigans with the scope of variables in block expressions.
This commit is contained in:
Lephenixnoir 2021-05-18 11:51:49 +02:00
parent 50629bf479
commit b1fa650914
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
2 changed files with 5 additions and 5 deletions

2
STATUS
View file

@ -32,7 +32,7 @@ DONE: Function/symbol/macro is defined, builds, links, and is tested
7.4 <ctype.h>
7.4.1 is*: DONE
7.4.2 to*: TEST
7.4.2 to*: DONE
7.5 <errno.h>
7.5.2 EDOM EILSEQ ERANGE: DONE

View file

@ -94,13 +94,13 @@ extern int toupper(int c);
})
#define tolower(c) ({ \
int __c = (c); \
isupper(__c) ? (__c | 0x20) : __c; \
int __c0 = (c); \
isupper(__c0) ? (__c0 | 0x20) : __c0; \
})
#define toupper(c) ({ \
int __c = (c); \
islower(__c) ? (__c & 0xdf) : __c; \
int __c0 = (c); \
islower(__c0) ? (__c0 & 0xdf) : __c0; \
})
#endif /*__CTYPE_H__*/