Commit a47b303b a47b303b1a6187001cfd5bc5ec6df25d6f6ffb98 by Sergey Poznyakoff

(util_do_command): Fixed coredump on unparseable input strings.

1 parent 3fe09d98
......@@ -121,7 +121,7 @@ util_do_command (const char *c, ...)
return 0;
}
if (argcv_get (cmd, delim, NULL, &argc, &argv) == 0)
if (argcv_get (cmd, delim, NULL, &argc, &argv) == 0 && argc > 0)
{
struct mail_command_entry entry;
char *p;
......@@ -152,10 +152,14 @@ util_do_command (const char *c, ...)
}
else
{
if (argc)
util_error (_("Unknown command: %s"), argv[0]);
else
util_error (_("Invalid command"));
status = 1;
}
argcv_free (argc, argv);
return status;
}
......