From 4e7b46d8e2d0b55aa108a63872a830b2ba16f77b Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Fri, 2 Aug 2002 13:36:54 +0000 Subject: [PATCH] Sligtly modify previous out-of-bounds fix: just break instead of return(NULL) for upward compatibility with more LC_* categories may be implemented in future. --- lib/libc/locale/setlocale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c index 9b80941dbbd..28df1c02de6 100644 --- a/lib/libc/locale/setlocale.c +++ b/lib/libc/locale/setlocale.c @@ -149,7 +149,7 @@ setlocale(category, locale) return (NULL); /* Hmm, just slashes... */ do { if (i == _LC_LAST) - return(NULL); /* Too many slashes... */ + break; /* Too many slashes... */ len = r - locale > ENCODING_LEN ? ENCODING_LEN : r - locale; (void)strlcpy(new_categories[i], locale, len + 1); i++;