diff options
Diffstat (limited to 'mdk-stage1/dietlibc/lib/tolower.c')
-rw-r--r-- | mdk-stage1/dietlibc/lib/tolower.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mdk-stage1/dietlibc/lib/tolower.c b/mdk-stage1/dietlibc/lib/tolower.c index 4b7c7cf2d..c24932ef4 100644 --- a/mdk-stage1/dietlibc/lib/tolower.c +++ b/mdk-stage1/dietlibc/lib/tolower.c @@ -1,6 +1,8 @@ #include <ctype.h> -inline int tolower(int c) { - return (c>='A' && c<='Z')?c-'A'+'a':c; +int tolower(int ch) { + if ( (unsigned int)(ch - 'A') < 26u ) + ch += 'a' - 'A'; + return ch; } |