diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2009-04-23 18:11:22 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2009-04-23 18:11:22 +0000 |
commit | 5921804481c346f032a24c19fc294cc5690e0f3b (patch) | |
tree | 3e71f94ad0832136ea7da2bfd4d0ad3c1ec1398c /newlib/libc/string/strlwr.c | |
parent | bbb9d4fde31f44a70a6fb42181dc86cb91791d7e (diff) | |
download | cygnal-5921804481c346f032a24c19fc294cc5690e0f3b.tar.gz cygnal-5921804481c346f032a24c19fc294cc5690e0f3b.tar.bz2 cygnal-5921804481c346f032a24c19fc294cc5690e0f3b.zip |
2009-04-23 Mike Burgess <wizardsguild@earthlink.net>
* libc/string/strcasecmp.c: Optimized rewrite.
* libc/string/strncasecmp.c: Fix description.
* libc/string/strlwr.c: Avoid passing signed char to tolower.
* libc/string/strupr.c: Avoid passing signed char to tolower.
Diffstat (limited to 'newlib/libc/string/strlwr.c')
-rw-r--r-- | newlib/libc/string/strlwr.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/newlib/libc/string/strlwr.c b/newlib/libc/string/strlwr.c index 47096d430..3b73dba4b 100644 --- a/newlib/libc/string/strlwr.c +++ b/newlib/libc/string/strlwr.c @@ -34,17 +34,13 @@ QUICKREF #include <ctype.h> char * -strlwr (a) - char *a; +_DEFUN (strlwr, (s), + char *s) { - char *ret = a; - - while (*a != '\0') + unsigned char *ucs = (unsigned char *) s; + for ( ; *ucs != '\0'; ucs++) { - if (isupper (*a)) - *a = tolower (*a); - ++a; + *ucs = tolower(*ucs); } - - return ret; + return s; } |