From d81a091605c6ebb7328644f3399f97f0f145f2d6 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 5 Feb 1997 19:17:10 +0000 Subject: Update the comment why range checking not needed Fix setrunelocale fail if called directly without prior setlocale call Should go in 2.2 --- lib/libc/locale/collate.c | 2 +- lib/libc/locale/setlocale.c | 2 +- lib/libc/locale/setrunelocale.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index 8a71158e07314..b875acb50481d 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 6d6041d1b188c..0a4bbc96578d2 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 65daa836ffe6c..42972065edca8 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); -- cgit v1.3