From 18cdce6c399d5725c0eec609a6a09979b7cead94 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 26 Aug 2007 19:06:26 +0200 Subject: [PATCH] justify_line(): Re-add wordlen == 0 test This fixes ELinks crashing on this with terminal width e.g. 103:

xxxx xxxx xxxx xxxxx xxxxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxx xxxxxxx xxx xxxxxxx xxx xxxx xxxx xxxx xx xxxx x xxx xxxx xxxx xx xxxx xxxx xxxx xxx—xxx xxxx xx—xxx xxxx x xxxx

This test was removed for an unknown reason in commit b1cc71778933502945d3b18482edc0a012fa4365. Discovered together with Miciah. --- src/document/html/renderer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/document/html/renderer.c b/src/document/html/renderer.c index 358a948a..13be18a8 100644 --- a/src/document/html/renderer.c +++ b/src/document/html/renderer.c @@ -1128,6 +1128,7 @@ justify_line(struct html_context *html_context, int y) assert(word_len >= 0); if_assert_failed continue; + if (!word_len) continue; word_shift = (word * diff) / (spaces - 1); new_start = word_start + word_shift;