diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-05-28 06:30:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-05-28 06:30:46 -0700 |
commit | 41db431321741fd89391278cddbf8b7a665eb6ba (patch) | |
tree | f03eb7c48f8e16dea6ca950682e03d56febefbc4 | |
parent | 05c12f824123b05f934d43cb6035a1f4dbec7d7f (diff) | |
download | txr-41db431321741fd89391278cddbf8b7a665eb6ba.tar.gz txr-41db431321741fd89391278cddbf8b7a665eb6ba.tar.bz2 txr-41db431321741fd89391278cddbf8b7a665eb6ba.zip |
streams: bugfix in string input seek error diagnostic.
* stream.c (string_in_seek): Update the value of len
with the calculated value so that the out-of-bounds
seek diagnostic diagnostic shows the string length
rather than nil.
-rw-r--r-- | stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2092,7 +2092,7 @@ static val string_in_seek(val stream, val off, enum strm_whence whence) lit("~a: ~s: negative position ~s disallowed"), self, stream, pos, nao); - if (gt(pos, len ? len : length_str(s->string))) + if (gt(pos, len ? len : (len = length_str(s->string)))) uw_throwf(file_error_s, lit("~a: ~s: position ~s lies beyond string length ~s"), self, stream, pos, len, nao); |