summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string/strupr.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/string/strupr.c')
-rw-r--r--newlib/libc/string/strupr.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/newlib/libc/string/strupr.c b/newlib/libc/string/strupr.c
index 3f346b840..350618e78 100644
--- a/newlib/libc/string/strupr.c
+++ b/newlib/libc/string/strupr.c
@@ -27,23 +27,20 @@ PORTABILITY
<<strupr>> requires no supporting OS subroutines.
QUICKREF
- strupr */
+ strupr
+*/
#include <string.h>
#include <ctype.h>
char *
-strupr (a)
- char *a;
+_DEFUN (strupr, (s),
+ char *s)
{
- char *ret = a;
-
- while (*a != '\0')
+ unsigned char *ucs = (unsigned char *) s;
+ for ( ; *ucs != '\0'; ucs++)
{
- if (islower (*a))
- *a = toupper (*a);
- ++a;
+ *ucs = toupper(*ucs);
}
-
- return ret;
+ return s;
}