From Brice Augustin: Use the correct packet length in randpkt.
[obnox/wireshark/wip.git] / randpkt.c
index 15a329818431f756554c63837eb8f67504bf76b1..47e4b597139ec40cd9c6be8d051aa1d5a443d861 100644 (file)
--- 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);