Fixed a couple of crashes.

This commit is contained in:
Alexandre Julliard 2004-03-09 03:44:52 +00:00
parent cadf6fc192
commit acead48cf8
2 changed files with 5 additions and 2 deletions

View File

@ -277,9 +277,12 @@ void spawn(const char* prefix, const strarray* args)
{ {
int i, status; int i, status;
strarray* arr = strarray_dup(args); strarray* arr = strarray_dup(args);
const char** argv = arr->base; const char** argv;
char* prog = 0; char* prog = 0;
strarray_add(arr, NULL);
argv = arr->base;
if (prefix) if (prefix)
{ {
const char* p; const char* p;
@ -294,7 +297,6 @@ void spawn(const char* prefix, const strarray* args)
} }
} }
strarray_add(arr, NULL);
if (verbose) if (verbose)
{ {
for(i = 0; argv[i]; i++) printf("%s ", argv[i]); for(i = 0; argv[i]; i++) printf("%s ", argv[i]);

View File

@ -669,6 +669,7 @@ int main(int argc, char **argv)
case 'x': case 'o': case 'D': case 'U': case 'x': case 'o': case 'D': case 'U':
case 'I': case 'A': case 'l': case 'u': case 'I': case 'A': case 'l': case 'u':
case 'b': case 'V': case 'G': case 'L': case 'b': case 'V': case 'G': case 'L':
case 'B':
if (argv[i][2]) option_arg = &argv[i][2]; if (argv[i][2]) option_arg = &argv[i][2];
else next_is_arg = 1; else next_is_arg = 1;
break; break;