summaryrefslogtreecommitdiffstats
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
commit7c09e25f5f611d2e17fc0c5b7f51802683107644 (patch)
treeaf3710bf3e7337f6c6c28f4786a94336b49ff7e6
parentb79eddb5ef66c17688572d20e44a60e49930b511 (diff)
downloadtxr-7c09e25f5f611d2e17fc0c5b7f51802683107644.tar.gz
txr-7c09e25f5f611d2e17fc0c5b7f51802683107644.tar.bz2
txr-7c09e25f5f611d2e17fc0c5b7f51802683107644.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.
-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);