Author: gschneider
Date: Fri Apr 22 21:29:30 2011
New Revision: 51434
URL:
http://svn.reactos.org/svn/reactos?rev=51434&view=rev
Log:
[ipconfig] Respect the size parameter in the LoadStringAndOem helper function, fixes
"ipconfig /?"
See issue #6146 for more details.
Modified:
trunk/reactos/base/applications/network/ipconfig/ipconfig.c
Modified: trunk/reactos/base/applications/network/ipconfig/ipconfig.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ipconfig/ipconfig.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ipconfig/ipconfig.c [iso-8859-1] Fri Apr 22
21:29:30 2011
@@ -28,13 +28,21 @@
int LoadStringAndOem(HINSTANCE hInst,
UINT uID,
LPTSTR szNode,
- int Siz
-)
-{
- TCHAR szTmp[25];
- int res = LoadString(hInst, uID, szTmp, sizeof(szTmp));
+ int byteSize
+)
+{
+ TCHAR *szTmp;
+ int res;
+
+ szTmp = (LPTSTR)HeapAlloc(ProcessHeap, 0, byteSize);
+ if (szTmp == NULL)
+ {
+ return 0;
+ }
+ res = LoadString(hInst, uID, szTmp, byteSize);
CharToOem(szTmp, szNode);
- return(res);
+ HeapFree(ProcessHeap, 0, szTmp);
+ return res;
}
LPTSTR GetNodeTypeName(UINT NodeType)
@@ -702,7 +710,7 @@
Size))
{
_tprintf(_T("%s"), lpUsage);
- }
+ }
}
}