Mercurial > gnulib
diff lib/obstack_printf.c @ 10206:927afe014a7d
Fix various problems in 'obstack-printf' module.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 14 Jun 2008 15:06:19 +0200 |
parents | 3384541effec |
children | e8d2c6fc33ad |
line wrap: on
line diff
--- a/lib/obstack_printf.c Fri Jun 13 06:40:53 2008 -0600 +++ b/lib/obstack_printf.c Sat Jun 14 15:06:19 2008 +0200 @@ -58,16 +58,16 @@ stack-allocated buffer and copy, to reduce the likelihood of a small-size malloc. Otherwise, print directly into the obstack. */ - const size_t cutoff = 1024; - char buf[cutoff]; + enum { CUTOFF = 1024 }; + char buf[CUTOFF]; char *base = obstack_next_free (obs); size_t len = obstack_room (obs); char *str; - if (len < cutoff) + if (len < CUTOFF) { base = buf; - len = cutoff; + len = CUTOFF; } str = vasnprintf (base, &len, format, args); if (!str)