diff options
author | 2009-06-04 23:34:32 +0000 | |
---|---|---|
committer | 2009-06-04 23:34:32 +0000 | |
commit | fc2c874363a6cbdefd4c26735c908e7a79c6606b (patch) | |
tree | 0d71e35ab428d150a30483c6293ce574d632ecba | |
parent | move logging functions out of imsg.h, make imsg.c more library ready (diff) | |
download | wireguard-openbsd-fc2c874363a6cbdefd4c26735c908e7a79c6606b.tar.xz wireguard-openbsd-fc2c874363a6cbdefd4c26735c908e7a79c6606b.zip |
Print a better message than '(null)' if no command is specified ("tmux \;").
-rw-r--r-- | usr.bin/tmux/cmd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index ebceb5486d5..e652abd4afb 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.2 2009/06/04 23:34:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -108,8 +108,10 @@ cmd_parse(int argc, char **argv, char **cause) int opt; *cause = NULL; - if (argc == 0) + if (argc == 0) { + xasprintf(cause, "no command"); return (NULL); + } entry = NULL; for (entryp = cmd_table; *entryp != NULL; entryp++) { |