summaryrefslogtreecommitdiff
path: root/lib/sh/unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sh/unicode.c')
-rw-r--r--lib/sh/unicode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sh/unicode.c b/lib/sh/unicode.c
index 9ee7147d..798260ec 100644
--- a/lib/sh/unicode.c
+++ b/lib/sh/unicode.c
@@ -78,13 +78,15 @@ stub_charset ()
s = strrchr (locale, '.');
if (s)
{
- strcpy (charsetbuf, s+1);
+ strncpy (charsetbuf, s+1, sizeof (charsetbuf) - 1);
+ charsetbuf[sizeof (charsetbuf) - 1] = '\0';
t = strchr (charsetbuf, '@');
if (t)
*t = 0;
return charsetbuf;
}
- strcpy (charsetbuf, locale);
+ strncpy (charsetbuf, locale, sizeof (charsetbuf) - 1);
+ charsetbuf[sizeof (charsetbuf) - 1] = '\0';
return charsetbuf;
}
#endif