X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fvmhsbr.c;h=cc92b49bbe91a13a5386b09277ab6d6d48eff081;hp=664c388e8ce513e78f3b0d0aab533b9d30e63733;hb=8f4c5da8971926f7eccc912f7998c343aef3c33b;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/uip/vmhsbr.c b/uip/vmhsbr.c index 664c388..cc92b49 100644 --- a/uip/vmhsbr.c +++ b/uip/vmhsbr.c @@ -12,6 +12,7 @@ #include #include +#include static char *types[] = { "OK", @@ -24,8 +25,6 @@ static FILE *fp = NULL; static int PEERrfd = NOTOK; static int PEERwfd = NOTOK; -extern int errno; - /* * static prototypes */ @@ -107,7 +106,7 @@ peer2rc (struct record *rc) if (fp) { fseek (fp, 0L, SEEK_END); fprintf (fp, "%d: <--- %s %d: \"%*.*s\"\n", (int) getpid(), - types[rc->rc_type], rc->rc_len, + types[(unsigned char)rc->rc_type], rc->rc_len, rc->rc_len, rc->rc_len, rc->rc_data); fflush (fp); } @@ -128,7 +127,7 @@ rc2peer (char code, int len, char *data) if (fp) { fseek (fp, 0L, SEEK_END); fprintf (fp, "%d: ---> %s %d: \"%*.*s\"\n", (int) getpid(), - types[rc->rc_type], rc->rc_len, + types[(unsigned char)rc->rc_type], rc->rc_len, rc->rc_len, rc->rc_len, data); fflush (fp); } @@ -165,11 +164,13 @@ fmt2peer (char code, char *fmt, ...) int err2peer (char code, char *what, char *fmt, ...) { + int return_value; va_list ap; va_start(ap, fmt); - verr2peer(code, what, fmt, ap); + return_value = verr2peer(code, what, fmt, ap); va_end(ap); + return return_value; /* This routine returned garbage before 1999-07-15. */ }