summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-03-07 06:09:50 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-03-07 06:09:50 -0800
commita3b0877584b9154bf5a5e2218e8ad07ea3c44ff3 (patch)
treec5fddf7e276b7f379dca5eeeca7ff11893ce55f7
parentede02a9fa6454d7462901f9997de1f9bef071379 (diff)
downloadtxr-a3b0877584b9154bf5a5e2218e8ad07ea3c44ff3.tar.gz
txr-a3b0877584b9154bf5a5e2218e8ad07ea3c44ff3.tar.bz2
txr-a3b0877584b9154bf5a5e2218e8ad07ea3c44ff3.zip
Bugfix: incorrect error string from stdio streams.
* stream.c (errno_to_string): Fix wrong test; it is a nil value of err which is the "no error" case, not non-nil. Due to this bug, any non-numeric error condition will be reported as "no error", including the case t ("eof").
-rw-r--r--stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index df1faa2d..bca44769 100644
--- a/stream.c
+++ b/stream.c
@@ -412,7 +412,7 @@ val errno_to_string(val err)
return lit("unspecified error");
else if (is_num(err))
return string_utf8(strerror(c_num(err)));
- else if (err)
+ else if (!err)
return lit("no error");
else if (err == t)
return lit("eof");