summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-18 20:13:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-18 20:13:25 -0700
commiteab5fb01f5cc396fd0265c501527a3ac7470c86c (patch)
tree2bb7651a5c3b51d7cceb1dcc84ab99f8975e3589
parent07abddf077005c3262ca4b04fca38c0e29eee218 (diff)
downloadtxr-eab5fb01f5cc396fd0265c501527a3ac7470c86c.tar.gz
txr-eab5fb01f5cc396fd0265c501527a3ac7470c86c.tar.bz2
txr-eab5fb01f5cc396fd0265c501527a3ac7470c86c.zip
buffers: bug: wrong object in format arguments.
* buf.c (buf_strm_seek): index is a BSD function; we want to refer to the local variable npos here. This was fortuitiously caught by GNU C++ which is obtains multiple overloaded declarations of index from somewhere, and so in this variable argument list situation thinks that there isn't enough context to resolve the overload.
-rw-r--r--buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/buf.c b/buf.c
index ce196976..349f0870 100644
--- a/buf.c
+++ b/buf.c
@@ -937,7 +937,7 @@ static val buf_strm_seek(val stream, val offset, enum strm_whence whence)
if (minusp(npos))
uw_throwf(error_s, lit("~a: cannot seek to negative position ~s"),
- self, index, nao);
+ self, npos, nao);
s->pos = npos;
return t;