summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-04-18 13:57:56 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-04-18 13:57:56 +0000
commit135480d0ab61464405f81a700409bf21bb994017 (patch)
tree9f3f1b0e4f045b2355d75c2ab8367618da788abb
parentc7a44df70eae152539b7cfc86ee59652ec3eacfa (diff)
downloadmandoc-135480d0ab61464405f81a700409bf21bb994017.tar.gz
Fix previous: i forgot explicit NUL termination;
noticed by Gonzalo <Tornaria at cmat dot edu dot uy>, thanks!
-rw-r--r--mansearch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mansearch.c b/mansearch.c
index 85920d0f..1a5eba7f 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -516,6 +516,8 @@ buildoutput(size_t im, struct dbm_page *page)
output = mandoc_malloc(sz);
i = 0;
lstcat(output, &i, input, " # ");
+ output[i++] = '\0';
+ assert(i == sz);
return output;
}