[bugfix] allocate size was inefficient
This commit is contained in:
parent
690e2cdba6
commit
89506d0ced
|
@ -144,7 +144,7 @@ read_symbol(pic_state *pic, struct pic_port *port, char c)
|
|||
c = next(port);
|
||||
}
|
||||
len += 1;
|
||||
buf = pic_realloc(pic, buf, len);
|
||||
buf = pic_realloc(pic, buf, len + 1);
|
||||
buf[len - 1] = c;
|
||||
} while (! isdelim(peek(port)));
|
||||
|
||||
|
|
Loading…
Reference in New Issue