diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-04 20:28:06 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-04 20:28:06 -0700 |
commit | 09a267a5b230f3d42aacb00188c3c168bbc4e42a (patch) | |
tree | 61b53a422e1d91eea03dd15c0437228c4a311428 /stream.c | |
parent | f4c63c7c6779b8dd9b1fc850d27b2a502486c1de (diff) | |
download | txr-09a267a5b230f3d42aacb00188c3c168bbc4e42a.tar.gz txr-09a267a5b230f3d42aacb00188c3c168bbc4e42a.tar.bz2 txr-09a267a5b230f3d42aacb00188c3c168bbc4e42a.zip |
* stream.c (inc_indent): If a negative indentation increment goes below
zero, clamp it at zero.
(set_indent): Clamp indentation value to zero.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2686,6 +2686,8 @@ val set_indent(val stream, val indent) cobj_handle(stream, stream_s)); val oldval = num(s->indent_chars); s->indent_chars = c_num(indent); + if (s->indent_chars < 0) + s->indent_chars = 0; return oldval; } @@ -2696,6 +2698,8 @@ val inc_indent(val stream, val delta) val oldval = num(s->indent_chars); val col = num(s->column); s->indent_chars = c_num(plus(delta, col)); + if (s->indent_chars < 0) + s->indent_chars = 0; return oldval; } |