changeset 28302:67a97fca157c

Generate the "preference" attribute correctly for candidates on locales where the decimal separator is ,
author Marcus Lundblad <ml@update.uu.se>
date Mon, 28 Sep 2009 18:11:28 +0000
parents 213a3449bb3c
children 9206aabf0251 858d9563ee8c a7e16735b218
files libpurple/protocols/jabber/google.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Mon Sep 28 06:44:46 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Mon Sep 28 18:11:28 2009 +0000
@@ -104,7 +104,8 @@
 
 	for (;candidates;candidates = candidates->next) {
 		JabberIq *iq;
-		gchar *ip, *port, *pref, *username, *password;
+		gchar *ip, *port, *username, *password;
+		gchar pref[16];
 		PurpleMediaCandidateType type;
 		xmlnode *sess;
 		xmlnode *candidate;
@@ -123,9 +124,8 @@
 		ip = purple_media_candidate_get_ip(transport);
 		port = g_strdup_printf("%d",
 				purple_media_candidate_get_port(transport));
-		pref = g_strdup_printf("%f",
-				purple_media_candidate_get_priority(transport)
-				/1000.0);
+		g_ascii_dtostr(pref, 16,
+			purple_media_candidate_get_priority(transport) / 1000.0);
 		username = purple_media_candidate_get_username(transport);
 		password = purple_media_candidate_get_password(transport);
 		type = purple_media_candidate_get_candidate_type(transport);
@@ -163,7 +163,6 @@
 
 		g_free(ip);
 		g_free(port);
-		g_free(pref);
 		g_free(username);
 		g_free(password);