"Hans Leidekker" hans@codeweavers.com wrote:
- while (1)
- {
hr = IStream_Read(pstmIn, src, sizeof(src), &bytes_read);
if (FAILED(hr)) goto exit;
srclen = bytes_read;
dstlen = buffer_size;
ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, NULL, &dstlen);
if (dstlen > buffer_size)
{
dst = HeapReAlloc(GetProcessHeap(), 0, dst, dstlen);
if (!dst) return E_OUTOFMEMORY;
buffer_size = dstlen;
}
hr = ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, dst, &dstlen);
if (FAILED(hr)) goto exit;
hr = IStream_Write(pstmOut, dst, dstlen, NULL);
if (FAILED(hr)) goto exit;
if (bytes_read != sizeof(src)) break;
- }
+exit:
'break' instead of 'goto' would be cleaner IMO.