Commit 9373d0a
authored
Fix EOF handling in calculator.dana main loop (#81)
Adds the following line at the start of the lines loop in `calculator.dana`:
```
buf[0] := '\0'
```
This ensures the buffer is always null-terminated before reading new input.
When `readString` reaches EOF without writing anything, `strlen(buf)` now returns 0 instead of reading stale data from previous iterations.1 parent 7061b05 commit 9373d0a
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
0 commit comments