]> git.lizzy.rs Git - linenoise.git/commitdiff
Fix first-chance exceptions in Windows
authorTad Marshall <tad@tadmarshall.com>
Mon, 17 Oct 2011 23:18:13 +0000 (19:18 -0400)
committerSteve Bennett <steveb@workware.net.au>
Mon, 30 Jan 2012 02:40:44 +0000 (12:40 +1000)
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

index 926c9721df63e1e976d7c344b343e4b28ead7384..315c2f4a55cee02021fc82f2a4bda89fe5a5206d 100644 (file)
@@ -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;
 }