wmc: Duplicate wine_cp_wcstombs check here too (Coverity).

This commit is contained in:
Marcus Meissner 2009-07-18 22:23:45 +02:00 committed by Alexandre Julliard
parent 0f6591af9d
commit 29bdb32592

View File

@ -396,8 +396,13 @@ static char *make_string(WCHAR *uc, int len, int codepage)
else
mlen = wine_utf8_wcstombs(0, uc, unistrlen(uc)+1, NULL, 0);
cc = tmp = xmalloc(mlen);
if((i = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, tmp, mlen, NULL, NULL)) < 0)
internal_error(__FILE__, __LINE__, "Buffer overflow? code %d\n", i);
if (cpdef) {
if((i = wine_cp_wcstombs(cpdef, 0, uc, unistrlen(uc)+1, tmp, mlen, NULL, NULL)) < 0)
internal_error(__FILE__, __LINE__, "Buffer overflow? code %d\n", i);
} else {
if((i = wine_utf8_wcstombs(0, uc, unistrlen(uc)+1, tmp, mlen)) < 0)
internal_error(__FILE__, __LINE__, "Buffer overflow? code %d\n", i);
}
*cptr++ = ' ';
*cptr++ = '"';
for(i = b = 0; i < len; i++, cc++)