diff options
author | Preston Pan <preston@nullring.xyz> | 2024-01-28 20:14:53 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-01-28 20:14:53 -0800 |
commit | 93b732e0d4485d61ced8c48740299fc6aa00f8b3 (patch) | |
tree | 93860e0266098553f165ff88fa5834402c47e6c2 /src/builtins.c | |
parent | 1e95a76aa28df41b36c1ec41e24287d6c1b4065b (diff) |
change version; add to readme
Diffstat (limited to 'src/builtins.c')
-rw-r--r-- | src/builtins.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/builtins.c b/src/builtins.c index 4446cb8..caf18c2 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -40,6 +40,8 @@ char *get_line(FILE *f) { if ((e = strrchr(ret, '\n'))) break; } + /* stackoverflow code patch: clearerr */ + clearerr(f); if (e) *e = '\0'; return ret; @@ -558,7 +560,6 @@ void stemfread(value_t *v) { void stemread(value_t *v) { value_t *retval = init_value(VSTR); char *a = get_line(stdin); - clearerr(stdin); retval->str_word = init_string(a); array_append(STACK, retval); free(a); |