summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1999-11-09 11:09:16 +0000
committerache <ache@FreeBSD.org>1999-11-09 11:09:16 +0000
commit1c9f0625c8ed7b226cf3ef2fc4fb0d22dee36a1e (patch)
tree94790d31255be0e451141b4c2a60b2c9d2461ffc /lib
parent8207ac2d1491e5e1c579fbe57adfd4cc86992384 (diff)
downloadFreeBSD-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.c4
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++;
+ }
}
}
OpenPOWER on IntegriCloud