mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Use FileGetString instead of ReadFile, because ReadFile doesn't return a null terminated string.
svn path=/trunk/; revision=16897
This commit is contained in:
parent
498a7947fe
commit
dc648e2083
1 changed files with 4 additions and 6 deletions
|
@ -37,7 +37,6 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||||
TCHAR buff[256];
|
TCHAR buff[256];
|
||||||
HANDLE hFile, hConsoleOut;
|
HANDLE hFile, hConsoleOut;
|
||||||
DWORD dwRead;
|
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
INT argc,i;
|
INT argc,i;
|
||||||
LPTSTR *argv;
|
LPTSTR *argv;
|
||||||
|
@ -105,21 +104,20 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
bRet = ReadFile(hFile,buff,sizeof(buff),&dwRead,NULL);
|
bRet = FileGetString (hFile, buff, sizeof(buff) / sizeof(TCHAR));
|
||||||
|
|
||||||
if(bPaging)
|
if(bPaging)
|
||||||
{
|
{
|
||||||
if(dwRead>0 && bRet)
|
if(bRet)
|
||||||
ConOutPrintfPaging(bFirstTime, buff);
|
ConOutPrintfPaging(bFirstTime, buff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(dwRead>0 && bRet)
|
if(bRet)
|
||||||
ConOutPrintf(buff);
|
ConOutPrintf(buff);
|
||||||
}
|
}
|
||||||
bFirstTime = FALSE;
|
bFirstTime = FALSE;
|
||||||
|
|
||||||
} while(dwRead>0 && bRet);
|
} while(bRet);
|
||||||
|
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue