diff options
author | fenner <fenner@FreeBSD.org> | 2001-04-03 07:45:48 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2001-04-03 07:45:48 +0000 |
commit | f7d9a5e270bfcbb075a637a52416185441d33d8d (patch) | |
tree | e79d9e6f58638911260708c956a0d44069782cda /contrib/tcpdump/print-ascii.c | |
parent | 04f715925eb0f85e1b7d21424cdbb3f6f1fa0b41 (diff) | |
parent | ace14a2b50f2cc05c079d0b9137b49066dbb1206 (diff) | |
download | FreeBSD-src-f7d9a5e270bfcbb075a637a52416185441d33d8d.zip FreeBSD-src-f7d9a5e270bfcbb075a637a52416185441d33d8d.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r75115,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/tcpdump/print-ascii.c')
-rw-r--r-- | contrib/tcpdump/print-ascii.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/tcpdump/print-ascii.c b/contrib/tcpdump/print-ascii.c index 29f57b8..8c086d2 100644 --- a/contrib/tcpdump/print-ascii.c +++ b/contrib/tcpdump/print-ascii.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.2.2.2 2000/01/11 06:58:23 fenner 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> @@ -72,7 +72,8 @@ ascii_print_with_offset(register const u_char *cp, register u_int length, while (--nshorts >= 0) { s1 = *cp++; s2 = *cp++; - (void)sprintf(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 : '.'); @@ -87,7 +88,8 @@ ascii_print_with_offset(register const u_char *cp, register u_int length, } if (length & 1) { s1 = *cp++; - (void)sprintf(hsp, " %02x", s1); + (void)snprintf(hsp, sizeof(hexstuff) - (hsp - hexstuff), + " %02x", s1); hsp += 3; *(asp++) = (isgraph(s1) ? s1 : '.'); ++i; |