diff --git a/src/mygetopt.c b/src/mygetopt.c index 90408f1..908d40c 100644 --- a/src/mygetopt.c +++ b/src/mygetopt.c @@ -63,7 +63,7 @@ int mygetopt(int argc, char * const _argv[], const char *optstring, if(tmp[1] == ':') { if(flag[2] != '\0') - myoptarg = tmp + 2; + myoptarg = flag + 2; else myoptarg = argv[myoptind++]; return ret;