From: <ebl...@us...> - 2006-08-16 02:44:26
|
Revision: 16778 Author: eblanton Date: 2006-08-15 19:44:21 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16778&view=rev Log Message: ----------- Thanks to Josh Blanton for this fix to MSN signon with non-glibc printf. This is a complete hack, but it's no worse than what is there now. Modified Paths: -------------- trunk/src/protocols/msn/nexus.c Modified: trunk/src/protocols/msn/nexus.c =================================================================== --- trunk/src/protocols/msn/nexus.c 2006-08-16 02:37:49 UTC (rev 16777) +++ trunk/src/protocols/msn/nexus.c 2006-08-16 02:44:21 UTC (rev 16778) @@ -293,7 +293,16 @@ } +/* this guards against missing hash entries */ +char * +nexus_challenge_data_lookup(GHashTable *challenge_data, const char *key) +{ + char *entry; + return (entry = (char *)g_hash_table_lookup(challenge_data, key)) ? + entry : "(null)"; +} + void login_connect_cb(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond) @@ -336,16 +345,16 @@ "Host: %s\r\n" "Connection: Keep-Alive\r\n" "Cache-Control: no-cache\r\n", - (char *)g_hash_table_lookup(nexus->challenge_data, "lc"), - (char *)g_hash_table_lookup(nexus->challenge_data, "id"), - (char *)g_hash_table_lookup(nexus->challenge_data, "tw"), - (char *)g_hash_table_lookup(nexus->challenge_data, "fs"), - (char *)g_hash_table_lookup(nexus->challenge_data, "ru"), + nexus_challenge_data_lookup(nexus->challenge_data, "lc"), + nexus_challenge_data_lookup(nexus->challenge_data, "id"), + nexus_challenge_data_lookup(nexus->challenge_data, "tw"), + nexus_challenge_data_lookup(nexus->challenge_data, "fs"), + nexus_challenge_data_lookup(nexus->challenge_data, "ru"), ctint, - (char *)g_hash_table_lookup(nexus->challenge_data, "kpp"), - (char *)g_hash_table_lookup(nexus->challenge_data, "kv"), - (char *)g_hash_table_lookup(nexus->challenge_data, "ver"), - (char *)g_hash_table_lookup(nexus->challenge_data, "tpf"), + nexus_challenge_data_lookup(nexus->challenge_data, "kpp"), + nexus_challenge_data_lookup(nexus->challenge_data, "kv"), + nexus_challenge_data_lookup(nexus->challenge_data, "ver"), + nexus_challenge_data_lookup(nexus->challenge_data, "tpf"), nexus->login_host); buffer = g_strdup_printf("%s,pwd=XXXXXXXX,%s\r\n", head, tail); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |