diff options
| author | Quentin Carbonneaux | 2015-03-02 21:08:33 -0500 |
|---|---|---|
| committer | Quentin Carbonneaux | 2015-03-02 21:08:33 -0500 |
| commit | 357d2d9f8bbddfd4d5c0aa421d4c14823f7475f3 (patch) | |
| tree | f3bf936907068bf38760aeee15fc2b0bee8be462 | |
| parent | 2a56964ca6cc62b528d9f7bbf9f1a396927d5c57 (diff) | |
fix bug in cpycode
| -rw-r--r-- | miniyacc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -863,10 +863,10 @@ cpycode() die("syntax error, unclosed code block"); if (c == '\n') lineno++; - s[pos++] = c; if (pos>=len) - if (!(s=realloc(s, 2*len+1))) + if (!(s=realloc(s, len=2*len+1))) die("out of memory"); + s[pos++] = c; } s[pos] = 0; return s; |
