Use unsigned char * variables when scanning buffer - saves casts and & 0xff
This commit is contained in:
parent
91fe418901
commit
e26801d6fb
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: key_debug.c,v 1.29 2004/10/29 19:31:04 dsl Exp $ */
|
||||
/* $NetBSD: key_debug.c,v 1.30 2004/10/30 08:22:40 dsl Exp $ */
|
||||
/* $KAME: key_debug.c,v 1.36 2003/06/27 06:46:01 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: key_debug.c,v 1.29 2004/10/29 19:31:04 dsl Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: key_debug.c,v 1.30 2004/10/30 08:22:40 dsl Exp $");
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include "opt_inet.h"
|
||||
|
@ -342,15 +342,15 @@ kdebug_sadb_identity(ext)
|
|||
#ifdef _KERNEL
|
||||
ipsec_hexdump((caddr_t)(id + 1), len); /*XXX cast ?*/
|
||||
#else
|
||||
char *p, *ep;
|
||||
unsigned char *p, *ep;
|
||||
printf("\n str=\"");
|
||||
p = (char *)(id + 1);
|
||||
p = (void *)(id + 1);
|
||||
ep = p + len;
|
||||
for (/*nothing*/; *p && p < ep; p++) {
|
||||
if (isprint((unsigned char)*p))
|
||||
printf("%c", *p & 0xff);
|
||||
if (isprint(*p))
|
||||
printf("%c", *p);
|
||||
else
|
||||
printf("\\%03o", *p & 0xff);
|
||||
printf("\\%03o", *p);
|
||||
}
|
||||
#endif
|
||||
printf("\"");
|
||||
|
|
Loading…
Reference in New Issue