api - buffer size off by 1 for joined commands
diff --git a/api.c b/api.c
index a4234eb..e3dc72d 100644
--- a/api.c
+++ b/api.c
@@ -4690,8 +4690,8 @@ void api(int api_thr_id)
if (!did) {
if (strchr(cmd, CMDJOIN)) {
firstjoin = isjoin = true;
- // cmd + leading '|' + '\0'
- cmdsbuf = malloc(strlen(cmd) + 2);
+ // cmd + leading+tailing '|' + '\0'
+ cmdsbuf = malloc(strlen(cmd) + 3);
if (!cmdsbuf)
quithere(1, "OOM cmdsbuf");
strcpy(cmdsbuf, "|");