From a21240a984ff343f876a4897ab0310eb38304fe7 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 4 May 2012 17:37:24 +0000 Subject: [PATCH] Now that you can specify negative indents in Halibut text mode, it's possible to specify an indent which is _overall_ negative, i.e. intended to be off the left-hand side of the text file. There's no nice way to handle this, but printing O(2^32) spaces in a while (n--) loop is particularly bad. Fix the loop to read while (n-- > 0), so that at least it doesn't get _that_ badly confused. git-svn-id: svn://svn.tartarus.org/sgt/halibut@9491 cda61777-01e9-0310-a592-d414129be87e --- bk_text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bk_text.c b/bk_text.c index 4f8cdd7..e323802 100644 --- a/bk_text.c +++ b/bk_text.c @@ -497,7 +497,7 @@ static void text_output_many(textfile *tf, int n, wchar_t c) wchar_t s[2]; s[0] = c; s[1] = L'\0'; - while (n--) + while (n-- > 0) text_output(tf, s); } -- 2.11.0