diff options
Diffstat (limited to 'libc/stdlib.c')
| -rw-r--r-- | libc/stdlib.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libc/stdlib.c b/libc/stdlib.c index 4301618..d1d357e 100644 --- a/libc/stdlib.c +++ b/libc/stdlib.c @@ -161,3 +161,17 @@ void assert_fail(const char *func, const char *file, int line) printf("\nAssertion failed in function %s in file %s, line %d\n", func, file, line); panic("assertion failed!\n"); } + +int toupper(int ch) +{ + if('a' <= ch && ch <= 'z') + return ch ^ (1<<5); + return ch; +} + +int tolower(int ch) +{ + if('A' <= ch && ch <= 'Z') + return ch ^ (1<<5); + return ch; +} |