Commit c19bb1ab authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed buffer length in history manipulation.

Writing new chars must be done with default attribute (not cell current attribute).
parent d547450b
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment