(execute): Prompted for a missing argument, but then passed a null

pointer to prexec() instead.  Some systems (GNU, Windows) deal
gracefully with printing null strings, others crash.
This commit is contained in:
Markus Armbruster 2007-11-15 19:03:27 +00:00
parent a877480082
commit bd0d5c10b6

View file

@ -278,13 +278,11 @@ execute(void)
failed = 0;
redir = NULL;
/* FIXME should use raw argument here, to support UTF-8 file names */
p = getstarg(player->argp[1], "File? ", buf);
if (p == NULL || *p == '\0')
return RET_SYN;
/* FIXME should use raw argument here, to support UTF-8 file names */
prexec(player->argp[1]);
prexec(p);
while (!failed && status()) {
if (recvclient(buf, sizeof(buf)) < 0)