fix possible buffer termination error (coverity 1195410)

This commit is contained in:
Vincent Sanders 2014-05-18 10:44:51 +01:00
parent 966ed9449c
commit 39518eb3c1

View File

@ -237,8 +237,8 @@ utf8_convert(const char *string,
iconv_close(last_cd.cd);
/* and copy the to/from/cd data into last_cd */
strncpy(last_cd.from, from, sizeof(last_cd.from));
strncpy(last_cd.to, to, sizeof(last_cd.to));
snprintf(last_cd.from, sizeof(last_cd.from), "%s", from);
snprintf(last_cd.to, sizeof(last_cd.to), "%s", to);
last_cd.cd = cd;
}