summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-02-05 19:17:10 +0000
committerache <ache@FreeBSD.org>1997-02-05 19:17:10 +0000
commitb7803f6c96c45c04974507c2a5e6cc4d79d35539 (patch)
tree5c0889ec26924f4d270f1ecc1e35b1373fc60755 /lib/libc/locale
parentc300efb53e9c56295df6f3145a4ddaa9428249aa (diff)
downloadFreeBSD-src-b7803f6c96c45c04974507c2a5e6cc4d79d35539.zip
FreeBSD-src-b7803f6c96c45c04974507c2a5e6cc4d79d35539.tar.gz
Update the comment why range checking not needed
Fix setrunelocale fail if called directly without prior setlocale call Should go in 2.2
Diffstat (limited to 'lib/libc/locale')
-rw-r--r--lib/libc/locale/collate.c2
-rw-r--r--lib/libc/locale/setlocale.c2
-rw-r--r--lib/libc/locale/setrunelocale.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index 8a71158..b875acb 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -73,7 +73,7 @@ __collate_load_tables(encoding)
__collate_load_error = save_load_error;
return -1;
}
- /* Range checking already done at upper level caller */
+ /* Range checking not needed, encoding has fixed size */
(void) strcpy(buf, _PathLocale);
(void) strcat(buf, "/");
(void) strcat(buf, encoding);
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c
index 6d6041d..0a4bbc9 100644
--- a/lib/libc/locale/setlocale.c
+++ b/lib/libc/locale/setlocale.c
@@ -302,7 +302,7 @@ const char *encoding;
return(0);
if (!_PathLocale)
return(1);
- /* Range checking already done at upper level caller */
+ /* Range checking not needed, encoding has fixed size */
strcpy(name, _PathLocale);
strcat(name, "/");
strcat(name, encoding);
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index 65daa83..4297206 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -84,8 +84,8 @@ _xpg4_setrunelocale(encoding)
}
if (!_PathLocale)
- return(EFAULT);
- /* Range checking already done at upper level caller */
+ _PathLocale = _PATH_LOCALE;
+ /* Range checking not needed, encoding has fixed size */
(void) strcpy(name, _PathLocale);
(void) strcat(name, "/");
(void) strcat(name, encoding);
OpenPOWER on IntegriCloud