[ipconfig] Respect the size parameter in the LoadStringAndOem helper function, fixes "ipconfig /?"

See issue #6146 for more details.

svn path=/trunk/; revision=51434
This commit is contained in:
Gregor Schneider 2011-04-22 21:29:30 +00:00
parent 63bd3c88e9
commit 6a89b41bff

View file

@ -28,13 +28,21 @@ HANDLE ProcessHeap;
int LoadStringAndOem(HINSTANCE hInst,
UINT uID,
LPTSTR szNode,
int Siz
)
int byteSize
)
{
TCHAR szTmp[25];
int res = LoadString(hInst, uID, szTmp, sizeof(szTmp));
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 @@ VOID Usage(VOID)
Size))
{
_tprintf(_T("%s"), lpUsage);
}
}
}
}