Commit 78b3c8b6 authored by Mart Lubbers's avatar Mart Lubbers

add varargs macro for debugging

parent 67a53e5e
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
#include "Clean.h" #include "Clean.h"
#ifdef DEBUG #ifdef DEBUG
#define debug(s) {puts(s); fflush(stdout);} #define debug(s, ...) {printf(s "\n", #__VA_ARGS__); fflush(stdout);}
#else #else
#define debug(s) ; #define debug(s, ...) ;
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
...@@ -198,10 +198,7 @@ void ttyreadline(int fd, CleanString *result, int *fdo) ...@@ -198,10 +198,7 @@ void ttyreadline(int fd, CleanString *result, int *fdo)
CleanStringLength(readlinecl) = charsread; CleanStringLength(readlinecl) = charsread;
*fdo = fd; *fdo = fd;
debug("Recv: "); debug("Recv: '%s'", buf);
debug(buf);
debug("\n");
free(buf);
debug("ttyreadline-done"); debug("ttyreadline-done");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment