summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgottox@rootkit.lan <gottox@rootkit.lan>2007-12-12 01:23:52 +0100
committergottox@rootkit.lan <gottox@rootkit.lan>2007-12-12 01:23:52 +0100
commit9efd0bcca9728cbf1815f9268e1aa9713702365f (patch)
tree41f9bdaf2f5b3d6d789901dce89dceb3ee1bfb4b
parentc17c953b3a849cff38aa59e0dc4b4f4c2a7a65f1 (diff)
Add missing \0
-rw-r--r--cmarkdown.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmarkdown.c b/cmarkdown.c
index a101e97..95177cf 100644
--- a/cmarkdown.c
+++ b/cmarkdown.c
@@ -140,6 +140,7 @@ dolineprefix(const char *begin, const char *end) {
continue;
if(!(buffer = malloc(end - p+1)))
eprint("Malloc failed.");
+ buffer[0] = '\0';
printf("\n<%s>",lineprefix[i].tag);
for(j = 0; p != end; p++, j++) {
buffer[j] = *p;
@@ -149,6 +150,7 @@ dolineprefix(const char *begin, const char *end) {
p += l;
}
}
+ buffer[j] = '\0';
if(lineprefix[i].process)
process(buffer,buffer+strlen(buffer));
else