#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.5 2000-01-17 06:24:24 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.6 2000-01-29 16:47:46 itojun Exp $";
#endif
#include <stdio.h>
#include <sys/types.h>
while (--nshorts >= 0) {
s1 = *cp++;
s2 = *cp++;
- (void)snprintf(hsp, sizeof(hsp), " %02x%02x", s1, s2);
+ (void)snprintf(hsp, sizeof(hexstuff) - (hsp - hexstuff),
+ " %02x%02x", s1, s2);
hsp += HEXDUMP_HEXSTUFF_PER_SHORT;
*(asp++) = (isgraph(s1) ? s1 : '.');
*(asp++) = (isgraph(s2) ? s2 : '.');
}
if (length & 1) {
s1 = *cp++;
- (void)snprintf(hsp, sizeof(hsp), " %02x", s1);
+ (void)snprintf(hsp, sizeof(hexstuff) - (hsp - hexstuff),
+ " %02x", s1);
hsp += 3;
*(asp++) = (isgraph(s1) ? s1 : '.');
++i;