diff options
author | bptato <nincsnevem662@gmail.com> | 2023-06-25 21:12:05 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-06-25 21:12:05 +0200 |
commit | 670e5dd9ae31a6d1bd34df2c7f2af5eabd213b54 (patch) | |
tree | 6d612b8a23ad030b4629afa2ce9985a0e1467732 | |
parent | 2ade1784f8b0476b32929e092250e01826342497 (diff) | |
download | chawan-670e5dd9ae31a6d1bd34df2c7f2af5eabd213b54.tar.gz |
rendertext: do not rewind if no other charsets are available
Fixes crash when the decoder fails to decode all given charsets.
-rw-r--r-- | src/render/rendertext.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/rendertext.nim b/src/render/rendertext.nim index ed79d60f..b0538cd8 100644 --- a/src/render/rendertext.nim +++ b/src/render/rendertext.nim @@ -54,7 +54,7 @@ proc renderStream*(grid: var FlexibleGrid, renderer: var StreamRenderer, len: in var n: int while true: n = renderer.decoder.readData(addr buf[0], buf.len * sizeof(buf[0])) - if renderer.decoder.failed: + if renderer.decoder.failed and renderer.charsets.len > 0: renderer.rewind() continue break |