use obstack_printf

This is not just nicer, it is also much safer, since we were
using sprintf...

* bootstrap.conf: Require it.
* src/system.h (obstack_fgrow1, obstack_fgrow2, obstack_fgrow3)
(obstack_fgrow4): Remove.
Adjust dependencies.
This commit is contained in:
Akim Demaille
2012-07-30 18:05:10 +02:00
parent dbfcf7a89f
commit aaf63e45b6
10 changed files with 44 additions and 68 deletions

View File

@@ -177,7 +177,7 @@ static void
muscle_syncline_grow (char const *key, location loc)
{
char *extension = NULL;
obstack_fgrow1 (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
obstack_printf (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
obstack_quote (&muscle_obstack,
quotearg_style (c_quoting_style, loc.start.file));
obstack_sgrow (&muscle_obstack, ")[");
@@ -269,9 +269,9 @@ muscle_boundary_grow (char const *key, boundary bound)
obstack_sgrow (&muscle_obstack, "[[");
obstack_escape (&muscle_obstack, bound.file);
obstack_1grow (&muscle_obstack, ':');
obstack_fgrow1 (&muscle_obstack, "%d", bound.line);
obstack_printf (&muscle_obstack, "%d", bound.line);
obstack_1grow (&muscle_obstack, '.');
obstack_fgrow1 (&muscle_obstack, "%d", bound.column);
obstack_printf (&muscle_obstack, "%d", bound.column);
obstack_sgrow (&muscle_obstack, "]]");
obstack_1grow (&muscle_obstack, '\0');
extension = obstack_finish (&muscle_obstack);