Mercurial > hg > index.cgi
comparison lwasm/pseudo.c @ 393:f2decd9b276d
Fix minor error in string parsing
Growing a buffer by 32 bytes and then only saying the buffer grew by one
byte is not exactly efficient. While not strictly broken, it's dumb. Fix it
to actually count the 32 bytes.
author | William Astle <lost@l-w.ca> |
---|---|
date | Tue, 14 Jul 2015 23:12:24 -0600 |
parents | 6ee9c67a0f8d |
children | 4411a6123716 |
comparison
equal
deleted
inserted
replaced
392:4c5d3b990a3f | 393:f2decd9b276d |
---|---|
304 { | 304 { |
305 l++; | 305 l++; |
306 if (blen >= bsize) | 306 if (blen >= bsize) |
307 { | 307 { |
308 str = lw_realloc(str, bsize + 32); | 308 str = lw_realloc(str, bsize + 32); |
309 bsize++; | 309 bsize += 32; |
310 } | 310 } |
311 str[blen++] = **p; | 311 str[blen++] = **p; |
312 } | 312 } |
313 } | 313 } |
314 else | 314 else |