[bugfix] allocate size was inefficient

This commit is contained in:
Yuichi Nishiwaki
2014-06-29 00:54:20 +09:00
parent 690e2cdba6
commit 89506d0ced
+1 -1
View File
@@ -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)));