Fix a bug with WriteFile

cvs
Mackenzie Straight 2004-12-13 23:00:07 +00:00
parent e074e36682
commit cbc8976e46
1 changed files with 5 additions and 3 deletions

View File

@ -16,13 +16,15 @@ void primitive_can_write (void)
void write_char_8 (F_PORT *port, F_FIXNUM ch) void write_char_8 (F_PORT *port, F_FIXNUM ch)
{ {
char buf = (char)ch; DWORD ignore;
WriteFile((HANDLE)port->fd, &buf, 1, NULL, NULL); BYTE buf = (BYTE)ch;
WriteFile((HANDLE)port->fd, &buf, 1, &ignore, NULL);
} }
void write_string_8 (F_PORT *port, F_STRING *str) void write_string_8 (F_PORT *port, F_STRING *str)
{ {
WriteFile((HANDLE)port->fd, to_c_string(str), str->capacity, NULL, NULL); DWORD ignore;
WriteFile((HANDLE)port->fd, to_c_string_unchecked(str), str->capacity, &ignore, NULL);
} }
void primitive_write_8 (void) void primitive_write_8 (void)