X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=lib%2Fgetopt_long.c;h=11d879ad2bfe70f4ab76d06bcc8aad20d36c4c16;hp=bdd524babf0c4a2ab0f175e386481be9e5d47522;hb=25c42559e065f5a94a696b7bbefa32426d7b8925;hpb=ee98e23416e8543bf48b734802cd1e49ed894f9e diff --git a/lib/getopt_long.c b/lib/getopt_long.c index bdd524ba..11d879ad 100644 --- 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