Add missing \0
This commit is contained in:
parent
c17c953b3a
commit
9efd0bcca9
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue