[F] Fixed cppcheck error

This commit is contained in:
seleznevae 2018-11-18 10:00:13 +03:00
parent a1b091f7da
commit 8aec98ff66
2 changed files with 4 additions and 2 deletions

View File

@ -2423,7 +2423,8 @@ int wsnprint_n_string(wchar_t *buf, size_t length, size_t n, const char *str)
wchar_t wcs[WCS_SIZE];
const char *ptr = str;
size_t wcs_len;
wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, NULL);
mbstate_t mbst;
wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, &mbst);
/* for simplicity */
if ((wcs_len == (size_t) - 1) || wcs_len > 1) {
return -1;

View File

@ -261,7 +261,8 @@ int wsnprint_n_string(wchar_t *buf, size_t length, size_t n, const char *str)
wchar_t wcs[WCS_SIZE];
const char *ptr = str;
size_t wcs_len;
wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, NULL);
mbstate_t mbst;
wcs_len = mbsrtowcs(wcs, (const char **)&ptr, WCS_SIZE, &mbst);
/* for simplicity */
if ((wcs_len == (size_t) - 1) || wcs_len > 1) {
return -1;