commit 25c430b1cd25d64c52d1c14834957abfaaeb69b6
Author: Nicholas Marriott <nicm@openbsd.org>
Date:   Wed May 15 15:34:09 2013 +0000

    Reserve space for \0 in cmd_print, from George Nachman.

diff --git a/cmd.c b/cmd.c
index d034870..e7290f2 100644
--- a/cmd.c
+++ b/cmd.c
@@ -295,8 +295,8 @@ cmd_print(struct cmd *cmd, char *buf, size_t len)
 	size_t	off, used;
 
 	off = xsnprintf(buf, len, "%s ", cmd->entry->name);
-	if (off < len) {
-		used = args_print(cmd->args, buf + off, len - off);
+	if (off + 1 < len) {
+		used = args_print(cmd->args, buf + off, len - off - 1);
 		if (used == 0)
 			off--;
 		else
