diff options
Diffstat (limited to 'src/lacconnection.c')
-rw-r--r-- | src/lacconnection.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/lacconnection.c b/src/lacconnection.c index c7f7740..1d89af6 100644 --- a/src/lacconnection.c +++ b/src/lacconnection.c @@ -153,18 +153,27 @@ lac_connection_write (LacConnection *connection, } void -lac_connection_write_cstr (LacConnection *connection, - const gchar *data) +lac_connection_write_printf (LacConnection *connection, + const gchar *format, + ...) { gsize len; + char *tmp; + va_list args; g_return_if_fail (connection != NULL); - g_return_if_fail (data != NULL); + g_return_if_fail (format != NULL); + + va_start (args, format); + + tmp = g_strdup_vprintf (format, args); - len = strlen (data); + len = strlen (tmp); if (len > 0) - lac_connection_write (connection, data, len); + lac_connection_write (connection, tmp, len); + + g_free (tmp); } const LacAddress * |