From 309e86246e8fb5859a5cfa20eb09a5848fa0724f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 24 Feb 2002 01:26:45 +0000 Subject: 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 --- randpkt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'randpkt.c') diff --git a/randpkt.c b/randpkt.c index 2b1192d7d6..da17a8aa4c 100644 --- a/randpkt.c +++ b/randpkt.c @@ -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 * @@ -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); -- cgit v1.2.1