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 /editcap.c | |
parent | f4f3208a00a0dd4ce9ff90077243c80767902ff1 (diff) |
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 'editcap.c')
-rw-r--r-- | editcap.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,7 +1,7 @@ /* Edit capture files. We can delete records, adjust timestamps, or * simply convert from one format to another format. * - * $Id: editcap.c,v 1.19 2002/02/08 10:07:33 guy Exp $ + * $Id: editcap.c,v 1.20 2002/02/24 01:26:42 guy Exp $ * * Originally written by Richard Sharpe. * Improved by Guy Harris. @@ -314,13 +314,13 @@ int main(int argc, char *argv[]) callback_arg args; extern char *optarg; extern int optind; - char opt; + int opt; char *p; int snapshot_length; /* Process the options first */ - while ((opt = getopt(argc, argv, "T:F:rvs:t:h")) != EOF) { + while ((opt = getopt(argc, argv, "T:F:rvs:t:h")) !=-1) { switch (opt) { |