summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/locale/collate.c8
-rw-r--r--lib/libc/locale/setrunelocale.c6
2 files changed, 5 insertions, 9 deletions
diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c
index a74a1a3..79e410c 100644
--- a/lib/libc/locale/collate.c
+++ b/lib/libc/locale/collate.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: collate.c,v 1.8 1996/10/23 15:35:43 ache Exp $
+ * $Id: collate.c,v 1.9 1996/11/26 02:49:31 ache Exp $
*/
#include <rune.h>
@@ -73,10 +73,8 @@ __collate_load_tables(encoding)
__collate_load_error = save_load_error;
return -1;
}
- strcpy(buf, _PathLocale);
- strcat(buf, "/");
- strcat(buf, encoding);
- strcat(buf, "/LC_COLLATE");
+ (void) snprintf(buf, sizeof buf, "%s/%s/LC_COLLATE",
+ _PathLocale, encoding);
if ((fp = fopen(buf, "r")) == NULL) {
__collate_load_error = save_load_error;
return -1;
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index 228efe29..cf68a43 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -85,10 +85,8 @@ _xpg4_setrunelocale(encoding)
if (!_PathLocale)
return(EFAULT);
- (void) strcpy(name, _PathLocale);
- (void) strcat(name, "/");
- (void) strcat(name, encoding);
- (void) strcat(name, "/LC_CTYPE");
+ (void) snprintf(name, sizeof name, "%s/%s/LC_CTYPE",
+ _PathLocale, encoding);
if ((fp = fopen(name, "r")) == NULL)
return(ENOENT);
OpenPOWER on IntegriCloud