Now that you can specify negative indents in Halibut text mode, it's
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 4 May 2012 17:37:24 +0000 (17:37 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 4 May 2012 17:37:24 +0000 (17:37 +0000)
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

index 4f8cdd7..e323802 100644 (file)
--- 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);
 }