+/* Formats FORMAT as a printf string, as if in the C locale,
+ and appends the result to ST. */
+void
+ds_put_c_vformat (struct string *st, const char *format, va_list args)
+{
+ char buf[128];
+ size_t len = sizeof buf;
+ char *output = c_vasnprintf (buf, &len, format, args);
+ if (output)
+ {
+ ds_put_cstr (st, output);
+ if (output != buf)
+ free (output);
+ }
+}
+