summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/fix_grouping.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/locale/fix_grouping.c')
-rw-r--r--lib/libc/locale/fix_grouping.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/locale/fix_grouping.c b/lib/libc/locale/fix_grouping.c
index 49211b7..a2675d8 100644
--- a/lib/libc/locale/fix_grouping.c
+++ b/lib/libc/locale/fix_grouping.c
@@ -28,6 +28,7 @@
#include <ctype.h>
#include <limits.h>
+#include <stddef.h>
static const char nogrouping[] = { CHAR_MAX, '\0' };
@@ -41,11 +42,11 @@ __fix_locale_grouping_str(const char *str) {
char *src, *dst;
char n;
- if (str == 0) {
+ if (str == NULL || *str == '\0') {
return nogrouping;
}
- for (src = (char*)str, dst = (char*)str; *src; src++) {
- char cur;
+
+ for (src = (char*)str, dst = (char*)str; *src != '\0'; src++) {
/* input string examples: "3;3", "3;2;-1" */
if (*src == ';')
OpenPOWER on IntegriCloud