projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee98e23
)
lib/getopt_long: clear 'optarg' every time
author
Jens Axboe
<axboe@kernel.dk>
Tue, 19 Mar 2013 16:47:15 +0000
(10:47 -0600)
committer
Jens Axboe
<axboe@kernel.dk>
Tue, 19 Mar 2013 16:47:15 +0000
(10:47 -0600)
We don't want a stale optarg argument to be available.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/getopt_long.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/getopt_long.c
b/lib/getopt_long.c
index bdd524babf0c4a2ab0f175e386481be9e5d47522..11d879ad2bfe70f4ab76d06bcc8aad20d36c4c16 100644
(file)
--- a/
lib/getopt_long.c
+++ b/
lib/getopt_long.c
@@
-46,6
+46,8
@@
int getopt_long_only(int argc, char *const *argv, const char *optstring,
const char *osptr;
int opt;
+ optarg = NULL;
+
/* getopt() relies on a number of different global state
variables, which can make this really confusing if there is
more than one use of getopt() in the same program. This