mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 01:02:12 +00:00
fix switch_file_printf
This commit is contained in:
parent
842ea87d64
commit
14678d54c1
@ -462,9 +462,18 @@ SWITCH_DECLARE(int) switch_file_printf(switch_file_t *thefile, const char *forma
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int ret;
|
int ret;
|
||||||
|
char *data;
|
||||||
|
|
||||||
va_start(ap, format);
|
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);
|
va_end(ap);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user