mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 12:23:30 +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:
@@ -37,7 +37,6 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||
TCHAR buff[256];
|
||||
HANDLE hFile, hConsoleOut;
|
||||
DWORD dwRead;
|
||||
BOOL bRet;
|
||||
INT argc,i;
|
||||
LPTSTR *argv;
|
||||
@@ -105,21 +104,20 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||
|
||||
do
|
||||
{
|
||||
bRet = ReadFile(hFile,buff,sizeof(buff),&dwRead,NULL);
|
||||
|
||||
bRet = FileGetString (hFile, buff, sizeof(buff) / sizeof(TCHAR));
|
||||
if(bPaging)
|
||||
{
|
||||
if(dwRead>0 && bRet)
|
||||
if(bRet)
|
||||
ConOutPrintfPaging(bFirstTime, buff);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dwRead>0 && bRet)
|
||||
if(bRet)
|
||||
ConOutPrintf(buff);
|
||||
}
|
||||
bFirstTime = FALSE;
|
||||
|
||||
} while(dwRead>0 && bRet);
|
||||
} while(bRet);
|
||||
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user