X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=io.c;h=478f731d8a6ee1c40ce3663a73741b8db041a7df;hb=60900035e6d0309705f2326ee50edc52386305e9;hp=88eb04544b65fcb378d6fffb71eebeb21f6ad212;hpb=e15efca6667b2673b4c1a5879a6917eab6800e58;p=polyglot.git diff --git a/io.c b/io.c index 88eb045..478f731 100644 --- a/io.c +++ b/io.c @@ -71,7 +71,7 @@ void io_close(io_t * io) { ASSERT(io->out_fd>=0); - my_log("Adapter>%s: EOF\n",io->name); + my_log("Adapter->%s: EOF\n",io->name); if (close(io->out_fd) == -1) { my_fatal("io_close(): close(): %s\n",strerror(errno)); @@ -196,8 +196,7 @@ bool io_get_line(io_t * io, char string[], int size) { void io_send(io_t * io, const char format[], ...) { - va_list arg_list; - char string[StringSize]; + char string[FormatBufferSize]; int len; ASSERT(io_is_ok(io)); @@ -207,9 +206,7 @@ void io_send(io_t * io, const char format[], ...) { // format - va_start(arg_list,format); - vsprintf(string,format,arg_list); - va_end(arg_list); + CONSTRUCT_ARG_STRING(format,string); // append string to buffer @@ -245,8 +242,7 @@ void io_send(io_t * io, const char format[], ...) { void io_send_queue(io_t * io, const char format[], ...) { - va_list arg_list; - char string[StringSize]; + char string[FormatBufferSize]; int len; ASSERT(io_is_ok(io)); @@ -256,9 +252,7 @@ void io_send_queue(io_t * io, const char format[], ...) { // format - va_start(arg_list,format); - vsprintf(string,format,arg_list); - va_end(arg_list); + CONSTRUCT_ARG_STRING(format,string); // append string to buffer