diff options
author | dan <[email protected]> | 2023-05-30 18:34:09 -0400 |
---|---|---|
committer | dan <[email protected]> | 2023-05-30 18:34:09 -0400 |
commit | 212a2f0dc7f6c21b115d9f659fe769c2dba9337c (patch) | |
tree | 4fd1d7613a4b8c24062db9b79f7f1fcff02eb86f | |
parent | bd2dac86684aaf5d4d469abcb5659b6535cea919 (diff) | |
download | forth-212a2f0dc7f6c21b115d9f659fe769c2dba9337c.tar.gz forth-212a2f0dc7f6c21b115d9f659fe769c2dba9337c.tar.bz2 forth-212a2f0dc7f6c21b115d9f659fe769c2dba9337c.zip |
fix: clear outputbuffer properly
-rw-r--r-- | forth.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -90,11 +90,9 @@ char* buffer_eval(int len, char* line) { s = stack_new(); initialised = true; outputline = 0; + outputbuffer = malloc(sizeof(char) * 1024); } - else { - free(outputbuffer); - } - outputbuffer = malloc(sizeof(char) * 1024); + strcpy(outputbuffer, ""); eval(ot, s, len, line); if (outputline) { outputline = 0; |