fixed the wrong argument handling problem

This commit is contained in:
hyunghwan.chung
2017-12-16 05:21:38 +00:00
parent 27fa6fa560
commit 49f0ff0bda
4 changed files with 19 additions and 20 deletions

View File

@ -2108,7 +2108,7 @@ static int handle_logopt (moo_t* moo, const moo_bch_t* str)
xtn->logfd = open (xstr, O_CREAT | O_WRONLY | O_APPEND , 0644);
if (xtn->logfd == -1)
{
fprintf (stderr, "ERROR: cannot open %s\n", xstr);
fprintf (stderr, "ERROR: cannot open a log file %s\n", xstr);
if (str != xstr) moo_freemem (moo, xstr);
return -1;
}
@ -2173,6 +2173,8 @@ int main (int argc, char* argv[])
goto print_usage;
}
}
if (opt.ind >= argc) goto print_usage;
#endif
memset (&vmprim, 0, MOO_SIZEOF(vmprim));
@ -2249,7 +2251,7 @@ int main (int argc, char* argv[])
#if defined(macintosh)
i = 20;
xtn->source_path = "test.st";
xtn->source_path = "test.moo";
goto compile;
#endif