fix switch_file_printf

This commit is contained in:
Anthony Minessale 2011-09-21 15:35:47 -05:00
parent 842ea87d64
commit 14678d54c1
1 changed files with 10 additions and 1 deletions

View File

@ -462,9 +462,18 @@ SWITCH_DECLARE(int) switch_file_printf(switch_file_t *thefile, const char *forma
{
va_list ap;
int ret;
char *data;
va_start(ap, format);
ret = apr_file_printf(thefile, format, ap);
if ((ret = switch_vasprintf(&data, format, ap)) != -1) {
switch_size_t bytes = strlen(data);
switch_file_write(thefile, data, &bytes);
free(data);
}
va_end(ap);
return ret;
}