On 1/3/20 11:56 PM, Alexandre Julliard wrote:
Nikolay Sivov nsivov@codeweavers.com writes:
@@ -424,7 +424,7 @@ static HRESULT WINAPI stream_ReadText( _Stream *iface, LONG len, BSTR *ret ) if (len == adReadAll) len = (stream->size - stream->pos) / sizeof(WCHAR); else len = min( len, stream->size - stream->pos / sizeof(WCHAR) );
- if (!(str = SysAllocStringLen( NULL, len ))) return E_OUTOFMEMORY;
- if (!(str = SysAllocStringLen( NULL, len + 1 ))) return E_OUTOFMEMORY; memcpy( str, stream->buf + stream->pos, len * sizeof(WCHAR) ); str[len] = 0;
SysAllocStringLen() already adds the final null.
Right, I missed that. In this case explicit termination after memcpy() is redundant, but harmless, it's easier to leave it as is.