summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-04 20:22:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-04 20:22:44 -0700
commitf4c63c7c6779b8dd9b1fc850d27b2a502486c1de (patch)
tree1e4c6296b8e04953dcbf86c1496765df4ef7d3f1
parent6a83bc09dbf0ae14e98c891b5a9fd0c424a0e07b (diff)
downloadtxr-f4c63c7c6779b8dd9b1fc850d27b2a502486c1de.tar.gz
txr-f4c63c7c6779b8dd9b1fc850d27b2a502486c1de.tar.bz2
txr-f4c63c7c6779b8dd9b1fc850d27b2a502486c1de.zip
* stream.c (vormat): Bugfix: when width specified as *
meets a negative argument, the width should be treated as positive and the field left aligned. Instead, the width is treated as zero.
-rw-r--r--ChangeLog7
-rw-r--r--stream.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a9419fc..1ed7ff51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2015-08-04 Kaz Kylheku <kaz@kylheku.com>
+ * stream.c (vormat): Bugfix: when width specified as *
+ meets a negative argument, the width should be treated
+ as positive and the field left aligned. Instead, the
+ width is treated as zero.
+
+2015-08-04 Kaz Kylheku <kaz@kylheku.com>
+
* stream.c (string_out_put_string): Do not return nil when
buffer calculations overflow, but throw exception.
diff --git a/stream.c b/stream.c
index cf1f5a96..a44db8db 100644
--- a/stream.c
+++ b/stream.c
@@ -2209,7 +2209,7 @@ val vformat(val stream, val fmtstr, va_list vl)
do_digits:
switch (saved_state) {
case vf_width:
- if (width < 0) {
+ if (digits < 0) {
width = -digits;
align = al_left;
} else {