# HG changeset patch # User Ethan Blanton # Date 1155696261 0 # Node ID 6666ce3176b906898b12970948ce3b04bbe0918b # Parent 38270d4e29c6d23c3afd1ba5132bad02c0d8d130 [gaim-migrate @ 16778] 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. committer: Tailor Script diff -r 38270d4e29c6 -r 6666ce3176b9 src/protocols/msn/nexus.c --- a/src/protocols/msn/nexus.c Wed Aug 16 02:37:49 2006 +0000 +++ b/src/protocols/msn/nexus.c Wed Aug 16 02:44:21 2006 +0000 @@ -293,6 +293,15 @@ } +/* 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, @@ -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);