diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-02-24 01:26:45 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-02-24 01:26:45 +0000 |
commit | 309e86246e8fb5859a5cfa20eb09a5848fa0724f (patch) | |
tree | 5d5414f667580c579229585b99b13c63065945ff /randpkt.c | |
parent | f4f3208a00a0dd4ce9ff90077243c80767902ff1 (diff) | |
download | wireshark-309e86246e8fb5859a5cfa20eb09a5848fa0724f.tar.gz wireshark-309e86246e8fb5859a5cfa20eb09a5848fa0724f.tar.bz2 wireshark-309e86246e8fb5859a5cfa20eb09a5848fa0724f.zip |
From Peter Valchev: fix editcap to assign the result of "getopt()" to an
"int" and to check "getopt()"s return value with -1 rather than EOF.
Fix other "getopt()" loops to check against -1 as well (EOF is -1 on
most if not all platforms, but the Single UNIX Specification says
"getopt()" returns -1, so we should check against -1, not EOF).
svn path=/trunk/; revision=4793
Diffstat (limited to 'randpkt.c')
-rw-r--r-- | randpkt.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4,7 +4,7 @@ * Creates random packet traces. Useful for debugging sniffers by testing * assumptions about the veracity of the data found in the packet. * - * $Id: randpkt.c,v 1.12 2002/02/14 17:45:07 gram Exp $ + * $Id: randpkt.c,v 1.13 2002/02/24 01:26:42 guy Exp $ * * Copyright (C) 1999 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -304,7 +304,7 @@ main(int argc, char **argv) int produce_max_bytes = 5000; pkt_example *example; - while ((opt = getopt(argc, argv, "b:c:t:")) != EOF) { + while ((opt = getopt(argc, argv, "b:c:t:")) != -1) { switch (opt) { case 'b': /* max bytes */ produce_max_bytes = atoi(optarg); |