diff options
author | phantom <phantom@FreeBSD.org> | 2001-02-12 08:55:12 +0000 |
---|---|---|
committer | phantom <phantom@FreeBSD.org> | 2001-02-12 08:55:12 +0000 |
commit | 1aaea1d55b79a0677db8d44a31ded8bf73ac7488 (patch) | |
tree | 373bd351621b39e9144ea27316e3dac29a090704 /lib | |
parent | 2c5a71ca7676a5e1691dce10895c67b0e0b0ad56 (diff) | |
download | FreeBSD-src-1aaea1d55b79a0677db8d44a31ded8bf73ac7488.zip FreeBSD-src-1aaea1d55b79a0677db8d44a31ded8bf73ac7488.tar.gz |
Assume that "" passed as parameter also means "no grouping"
Make comparsions more clear (per style(9))
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 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 == ';') |