diff options
author | ache <ache@FreeBSD.org> | 1999-11-09 11:09:16 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1999-11-09 11:09:16 +0000 |
commit | 1c9f0625c8ed7b226cf3ef2fc4fb0d22dee36a1e (patch) | |
tree | 94790d31255be0e451141b4c2a60b2c9d2461ffc /lib | |
parent | 8207ac2d1491e5e1c579fbe57adfd4cc86992384 (diff) | |
download | FreeBSD-src-1c9f0625c8ed7b226cf3ef2fc4fb0d22dee36a1e.zip FreeBSD-src-1c9f0625c8ed7b226cf3ef2fc4fb0d22dee36a1e.tar.gz |
Fix dead loop if locale contains / and not all categories specified
PR: 14742
Submitted by: peter@wahoo.com.tw
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/setlocale.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c index 44d0dfe..179be54 100644 --- a/lib/libc/locale/setlocale.c +++ b/lib/libc/locale/setlocale.c @@ -169,9 +169,11 @@ setlocale(category, locale) ++locale; while (*++r && *r != '/'); } while (*locale); - while (i < _LC_LAST) + while (i < _LC_LAST) { (void)strcpy(new_categories[i], new_categories[i-1]); + i++; + } } } |