diff options
| author | Alexey Zelkin <phantom@FreeBSD.org> | 2001-02-12 08:55:12 +0000 |
|---|---|---|
| committer | Alexey Zelkin <phantom@FreeBSD.org> | 2001-02-12 08:55:12 +0000 |
| commit | ba4a5c925a38aec37372c24eed502b528c2355fc (patch) | |
| tree | ee61d216aabf704c7d472079be354d9d5ffa77b9 /lib | |
| parent | 4e86238071b192376f3f9a930728ab415e6913a4 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/locale/fix_grouping.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/locale/fix_grouping.c b/lib/libc/locale/fix_grouping.c index 49211b7c7e39..a2675d8eb9d2 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 == ';') |
