From 958fd447744018e39b9c80fe9b1fdf43b6b08e42 Mon Sep 17 00:00:00 2001 From: Tad Marshall Date: Mon, 17 Oct 2011 19:18:13 -0400 Subject: [PATCH] Fix first-chance exceptions in Windows A call to WriteConsoleOutputCharacter() didn't have its final parameter set, passing a zero instead of a pointer to where to return the char count. I added the same code that was there for FillConsoleOutputCharacter() and FillConsoleOutputAttribute(), just allocate a dummy 'n' and pass its address. --- linenoise.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linenoise.c b/linenoise.c index 926c972..315c2f4 100644 --- a/linenoise.c +++ b/linenoise.c @@ -537,7 +537,9 @@ static void cursorToLeft(struct current *current) static int outputChars(struct current *current, const char *buf, int len) { COORD pos = { current->x, current->y }; - WriteConsoleOutputCharacter(current->outh, buf, len, pos, 0); + DWORD n; + + WriteConsoleOutputCharacter(current->outh, buf, len, pos, &n); current->x += len; return 0; } -- 2.44.0