[F] Fixed error

This commit is contained in:
seleznevae 2018-11-18 10:19:36 +03:00
parent 86291945c0
commit aeb33ee646
2 changed files with 2 additions and 0 deletions

View File

@ -2424,6 +2424,7 @@ int wsnprint_n_string(wchar_t *buf, size_t length, size_t n, const char *str)
const char *ptr = str; const char *ptr = str;
size_t wcs_len; size_t wcs_len;
mbstate_t mbst; mbstate_t mbst;
memset(&mbst, 0, sizeof(mbst));
wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, &mbst); wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, &mbst);
/* for simplicity */ /* for simplicity */
if ((wcs_len == (size_t) - 1) || wcs_len > 1) { if ((wcs_len == (size_t) - 1) || wcs_len > 1) {

View File

@ -262,6 +262,7 @@ int wsnprint_n_string(wchar_t *buf, size_t length, size_t n, const char *str)
const char *ptr = str; const char *ptr = str;
size_t wcs_len; size_t wcs_len;
mbstate_t mbst; mbstate_t mbst;
memset(&mbst, 0, sizeof(mbst));
wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, &mbst); wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, &mbst);
/* for simplicity */ /* for simplicity */
if ((wcs_len == (size_t) - 1) || wcs_len > 1) { if ((wcs_len == (size_t) - 1) || wcs_len > 1) {