- improvements of how message contents are printed, which is #if 0'd

anyway :)
This commit is contained in:
Adam Olsen 2001-09-18 07:26:12 +00:00
parent e3bf60bda3
commit f2cf4388d9

View file

@ -47,6 +47,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h>
#include "protocol.h" #include "protocol.h"
@ -240,15 +241,20 @@ QW_Master (struct sockaddr_in *addr)
#endif #endif
#if 0 #if 0
printf ("Contents:"); printf ("Message Contents: '");
{ // so that 'j' isn't unused when commented out { // so that 'j' isn't unused when commented out
int j; int j;
for (j = 0; j < size; j++) for (j = 0; j < size; j++)
printf (" %02x", buf[j]); if (isprint (buf[j]))
printf ("%c", buf[j]);
else {
switch (buf[j]) {
case '\n': printf ("\\n"); break;
case '\0': printf ("\\0"); break;
default: printf ("(%02x)", buf[j]);
} }
printf ("\n"); }
buf[size] = '\0'; printf ("'\n");
printf ("in ascii: '%s'\n", buf);
#endif #endif
QW_TimeoutHearts (servers, serverlen); QW_TimeoutHearts (servers, serverlen);