from the argument, rather than the argument itself, when testing whether
it should be printed or not (the argument might well be a sign-extended
version of an 8-bit character, in which case it's < 0x80 as it's
negative, but it can't be safely handed to "isprint()").
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.73 2002-06-11 17:09:01 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.74 2002-07-16 03:58:16 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
unsigned char ch;
ch = (unsigned char)(c & 0xff);
- if (c < 0x80 && isprint(c))
- printf("%c", c & 0xff);
+ if (ch < 0x80 && isprint(ch))
+ printf("%c", ch & 0xff);
else
- printf("\\%03o", c & 0xff);
+ printf("\\%03o", ch & 0xff);
}