mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
Fixed buffer length in history manipulation.
Writing new chars must be done with default attribute (not cell current attribute).
This commit is contained in:
parent
d547450b35
commit
c19bb1ab3f
@ -1379,9 +1379,9 @@ int CONSOLE_GetHistory(int idx, WCHAR* buf, int buf_len)
|
||||
{
|
||||
req->handle = 0;
|
||||
req->index = idx;
|
||||
if (buf && buf_len > sizeof(WCHAR))
|
||||
if (buf && buf_len > 1)
|
||||
{
|
||||
wine_server_set_reply( req, buf, buf_len - sizeof(WCHAR) );
|
||||
wine_server_set_reply( req, buf, (buf_len - 1) * sizeof(WCHAR) );
|
||||
}
|
||||
if (!wine_server_call_err( req ))
|
||||
{
|
||||
|
@ -175,8 +175,8 @@ static void WCEL_InsertString(WCEL_Context* ctx, const WCHAR* str)
|
||||
memcpy(&ctx->line[ctx->ofs], str, len * sizeof(WCHAR));
|
||||
ctx->len += len;
|
||||
ctx->line[ctx->len] = 0;
|
||||
WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], ctx->len - ctx->ofs,
|
||||
WCEL_GetCoord(ctx, ctx->ofs), NULL);
|
||||
SetConsoleCursorPosition(ctx->hConOut, WCEL_GetCoord(ctx, ctx->ofs));
|
||||
WriteConsoleW(ctx->hConOut, &ctx->line[ctx->ofs], ctx->len - ctx->ofs, NULL, NULL);
|
||||
ctx->ofs += len;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user