summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-07 20:56:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-07 20:56:40 -0700
commit6d56f397e2c4a0cdbc9aff0a38fa29c3196986c4 (patch)
treeaf3710bf3e7337f6c6c28f4786a94336b49ff7e6 /stream.c
parented9af7616e76f0a5111d3e5a56eb9d1d3025c1a6 (diff)
downloadtxr-6d56f397e2c4a0cdbc9aff0a38fa29c3196986c4.tar.gz
txr-6d56f397e2c4a0cdbc9aff0a38fa29c3196986c4.tar.bz2
txr-6d56f397e2c4a0cdbc9aff0a38fa29c3196986c4.zip
small bug in format: handle missing format char.
* stream.c (formatv): When the format string ends at the point where the format character is expected to occur, do not emit an error about #\nul being an unknown format directive character; emit an error that the character is missing.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stream.c b/stream.c
index b5819521..d85cd13b 100644
--- a/stream.c
+++ b/stream.c
@@ -3233,6 +3233,8 @@ val formatv(val stream_in, val fmtstr, struct args *al)
else
inc_indent(stream, num(width));
continue;
+ case 0:
+ uw_throwf(error_s, lit("missing format directive character"), nao);
default:
uw_throwf(error_s, lit("unknown format directive character ~s\n"),
chr(ch), nao);