aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2018-01-20 12:31:03 +0000
committerTatsuya Kinoshita <tats@debian.org>2018-01-20 12:31:03 +0000
commit8354763b90490d4105695df52674d0fcef823e92 (patch)
treed130b83bb81701bafc3a6fbd318cba12a7d5c9e8
parentUpdate ChangeLog (diff)
downloadw3m-8354763b90490d4105695df52674d0fcef823e92.tar.gz
w3m-8354763b90490d4105695df52674d0fcef823e92.zip
Prevent negative indent value in feed_table_block_tag()
Bug-Debian: https://github.com/tats/w3m/issues/88
Diffstat (limited to '')
-rw-r--r--table.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/table.c b/table.c
index 221db92..4f193e1 100644
--- a/table.c
+++ b/table.c
@@ -2356,10 +2356,14 @@ feed_table_block_tag(struct table *tbl,
if (mode->indent_level < MAX_INDENT_LEVEL)
tbl->indent -= INDENT_INCR;
}
+ if (tbl->indent < 0)
+ tbl->indent = 0;
offset = tbl->indent;
if (cmd == HTML_DT) {
if (mode->indent_level > 0 && mode->indent_level <= MAX_INDENT_LEVEL)
offset -= INDENT_INCR;
+ if (offset < 0)
+ offset = 0;
}
if (tbl->indent > 0) {
check_minimum0(tbl, 0);