summaryrefslogtreecommitdiff
path: root/src/share/utf8/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/utf8/utf8.c')
-rw-r--r--src/share/utf8/utf8.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/share/utf8/utf8.c b/src/share/utf8/utf8.c
index 98a0b648..34af187b 100644
--- a/src/share/utf8/utf8.c
+++ b/src/share/utf8/utf8.c
@@ -29,6 +29,7 @@
# include <config.h>
#endif
+#include <stdio.h>
#include <stdlib.h>
#include "share/alloc.h"
@@ -180,7 +181,7 @@ static int convert_string(const char *fromcode, const char *tocode,
s = safe_malloc_add_2op_(fromlen, /*+*/1);
if (!s)
return -1;
- safe_strncpy(s, from, fromlen + 1);
+ snprintf(s, fromlen + 1, "%s", from);
*to = s;
for (; *s; s++)
if (*s & ~0x7f)