mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
don't overwrite terminating \0 char
some code cleanup svn path=/trunk/; revision=32083
This commit is contained in:
parent
ddf20ad13d
commit
9b8be30ee9
2 changed files with 3 additions and 4 deletions
|
@ -1465,7 +1465,7 @@ ProcessInput (BOOL bFlag)
|
|||
}
|
||||
}
|
||||
|
||||
if (_istcntrl (*ip))
|
||||
if (*ip != _T('\0') && (_istcntrl (*ip)))
|
||||
*ip = _T(' ');
|
||||
*cp++ = *ip++;
|
||||
|
||||
|
|
|
@ -454,13 +454,12 @@ BOOL FileGetString (HANDLE hFile, LPTSTR lpBuffer, INT nBufferLength)
|
|||
LPSTR lpString;
|
||||
CHAR ch;
|
||||
DWORD dwRead;
|
||||
INT len;
|
||||
INT len = 0;
|
||||
#ifdef _UNICODE
|
||||
lpString = cmd_alloc(nBufferLength);
|
||||
#else
|
||||
lpString = lpBuffer;
|
||||
#endif
|
||||
len = 0;
|
||||
while ((--nBufferLength > 0) &&
|
||||
ReadFile(hFile, &ch, 1, &dwRead, NULL) && dwRead)
|
||||
{
|
||||
|
@ -482,7 +481,7 @@ BOOL FileGetString (HANDLE hFile, LPTSTR lpBuffer, INT nBufferLength)
|
|||
|
||||
lpString[len++] = _T('\0');
|
||||
#ifdef _UNICODE
|
||||
MultiByteToWideChar(CP_ACP, 0, lpString, len, lpBuffer, len);
|
||||
MultiByteToWideChar(CP_ACP, 0, lpString, -1, lpBuffer, len);
|
||||
cmd_free(lpString);
|
||||
#endif
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue