{
for (;;)
{
+ char directive;
size_t copy = strcspn (format, "%");
ds_put_substring (output, ss_buffer (format, copy));
format += copy;
return;
assert (*format == '%');
format++;
- switch (*format++)
+ directive = *format++;
+ switch (directive)
{
case 's':
{
break;
case 'f':
+ case 'g':
{
+ char conv[3];
double d = va_arg (args, double);
- switch (*format++)
- {
- case 'p':
- ds_put_c_format (output, "%f", d);
- break;
- default:
- NOT_REACHED ();
- }
+ conv[0]='%';
+ conv[1]=directive;
+ conv[2]='\0';
+ ds_put_c_format (output, conv, d);
break;
}