aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-07-26 16:54:08 +0000
committerGerald Combs <gerald@wireshark.org>2005-07-26 16:54:08 +0000
commitdb5add1cc3bed4683206f859ee20ee6eb5969ddf (patch)
tree8d8091f7744ce05f399f5fd2fc6c7e7f3847b959
parenta64a4043c3bfbde4f22782253d3ab5a64e416f98 (diff)
From Brice Augustin: Use the correct packet length in randpkt.
Build randpkt.exe by default under Windows. svn path=/trunk/; revision=15092
-rw-r--r--Makefile.nmake2
-rw-r--r--randpkt.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.nmake b/Makefile.nmake
index ea82d4093e..12c062b7dd 100644
--- a/Makefile.nmake
+++ b/Makefile.nmake
@@ -104,7 +104,7 @@ randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
$(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib
EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe \
- capinfos.exe editcap.exe mergecap.exe text2pcap.exe
+ capinfos.exe editcap.exe mergecap.exe text2pcap.exe randpkt.exe
RESOURCES=image\ethereal.res image\libethereal.res image\tethereal.res \
image\capinfos.res image\editcap.res image\mergecap.res \
diff --git a/randpkt.c b/randpkt.c
index 15a3298184..47e4b59713 100644
--- a/randpkt.c
+++ b/randpkt.c
@@ -515,7 +515,7 @@ main(int argc, char **argv)
pkthdr.len = len_this_pkt;
pkthdr.ts.tv_sec = i; /* just for variety */
- for (j = example->sample_length; j < len_random; j++) {
+ for (j = example->sample_length; j < len_this_pkt; j++) {
/* Add format strings here and there */
if ((int) (100.0*rand()/(RAND_MAX+1.0)) < 3 && j < (len_random - 3)) {
memcpy(&buffer[j], "%s", 3);