diff options
author | tege <tege@gmplib.org> | 2002-12-17 17:57:56 +0100 |
---|---|---|
committer | tege <tege@gmplib.org> | 2002-12-17 17:57:56 +0100 |
commit | 6113a536e971820ac1bd2cfcea47e32150c456db (patch) | |
tree | 4877ac060bc38f332fc182468a75755cf08cd95d /printf | |
parent | a1821a07312e36270638f25a8fd3eb63951d5f3b (diff) | |
download | gmp-6113a536e971820ac1bd2cfcea47e32150c456db.tar.gz |
(gmp_fprintf_reps): Make it actually work for padding > 256.
Diffstat (limited to 'printf')
-rw-r--r-- | printf/printffuns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/printf/printffuns.c b/printf/printffuns.c index 240ec792f..c120cc451 100644 --- a/printf/printffuns.c +++ b/printf/printffuns.c @@ -59,9 +59,9 @@ gmp_fprintf_reps (FILE *fp, int c, int reps) ASSERT (reps >= 0); memset (buf, c, MIN (reps, sizeof (buf))); - for (i = reps; i > 0; i -= piece) + for (i = reps; i > 0; i -= sizeof (buf)) { - piece = MIN (reps, sizeof (buf)); + piece = MIN (i, sizeof (buf)); ret = fwrite (buf, 1, piece, fp); if (ret == -1) return ret; |