Thomas Faber : mshtml: Fix MSVC build in htmllocation.c.
Alexandre Julliard
julliard at winehq.org
Thu Nov 17 12:52:35 CST 2011
Module: wine
Branch: master
Commit: 8ab355ab723a81da4fe02e380296f85122aac4a3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8ab355ab723a81da4fe02e380296f85122aac4a3
Author: Thomas Faber <thfabba at gmx.de>
Date: Thu Nov 17 12:50:11 2011 +0100
mshtml: Fix MSVC build in htmllocation.c.
---
dlls/mshtml/htmllocation.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmllocation.c b/dlls/mshtml/htmllocation.c
index 9c90edc..cf591d7 100644
--- a/dlls/mshtml/htmllocation.c
+++ b/dlls/mshtml/htmllocation.c
@@ -293,10 +293,10 @@ static HRESULT WINAPI HTMLLocation_get_protocol(IHTMLLocation *iface, BSTR *p)
FIXME("Unexpected blank protocol\n");
return E_NOTIMPL;
}else {
- WCHAR buf[url.dwSchemeLength + 1];
+ WCHAR *buf;
+ buf = *p = SysAllocStringLen(NULL, url.dwSchemeLength + 1);
memcpy(buf, url.lpszScheme, url.dwSchemeLength * sizeof(WCHAR));
buf[url.dwSchemeLength] = ':';
- *p = SysAllocStringLen(buf, url.dwSchemeLength + 1);
}
if(!*p)
return E_OUTOFMEMORY;
@@ -334,13 +334,13 @@ static HRESULT WINAPI HTMLLocation_get_host(IHTMLLocation *iface, BSTR *p)
if(url.nPort) {
/* <hostname>:<port> */
const WCHAR format[] = {'%','u',0};
- DWORD len = url.dwHostNameLength + 1 + 5 + 1;
- WCHAR buf[len];
+ DWORD len = url.dwHostNameLength + 1 + 5;
+ WCHAR *buf;
+ buf = *p = SysAllocStringLen(NULL, len);
memcpy(buf, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR));
buf[url.dwHostNameLength] = ':';
snprintfW(buf + url.dwHostNameLength + 1, 6, format, url.nPort);
- *p = SysAllocString(buf);
}else
*p = SysAllocStringLen(url.lpszHostName, url.dwHostNameLength);
More information about the wine-cvs
mailing list