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->handle = 0;
|
||||||
req->index = idx;
|
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 ))
|
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));
|
memcpy(&ctx->line[ctx->ofs], str, len * sizeof(WCHAR));
|
||||||
ctx->len += len;
|
ctx->len += len;
|
||||||
ctx->line[ctx->len] = 0;
|
ctx->line[ctx->len] = 0;
|
||||||
WriteConsoleOutputCharacterW(ctx->hConOut, &ctx->line[ctx->ofs], ctx->len - ctx->ofs,
|
SetConsoleCursorPosition(ctx->hConOut, WCEL_GetCoord(ctx, ctx->ofs));
|
||||||
WCEL_GetCoord(ctx, ctx->ofs), NULL);
|
WriteConsoleW(ctx->hConOut, &ctx->line[ctx->ofs], ctx->len - ctx->ofs, NULL, NULL);
|
||||||
ctx->ofs += len;
|
ctx->ofs += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue