# HG changeset patch # User Etan Reisner # Date 1234418415 0 # Node ID 1946af16163028137f048495b38c9402fca4d87d # Parent e0a6a829df87c320a43b4f197ce76e38e1c70604 Let XS do the argument checking/erroring for us for the components argument to Purple::Serv::join_chat, we weren't doing any before. Closes #8199. diff -r e0a6a829df87 -r 1946af161630 libpurple/plugins/perl/common/Server.xs --- a/libpurple/plugins/perl/common/Server.xs Wed Feb 11 03:31:33 2009 +0000 +++ b/libpurple/plugins/perl/common/Server.xs Thu Feb 12 06:00:15 2009 +0000 @@ -122,29 +122,28 @@ Purple::Connection gc const char *name -void -serv_join_chat(con, components) - Purple::Connection con - SV * components -INIT: - HV * t_HV; - HE * t_HE; - SV * t_SV; - GHashTable * t_GHash; +void +serv_join_chat(conn, components) + Purple::Connection conn + HV * components +PREINIT: + HE *t_HE; + SV *t_SV; I32 len; + GHashTable *t_GHash; char *t_key, *t_value; CODE: - t_HV = (HV *)SvRV(components); t_GHash = g_hash_table_new(g_str_hash, g_str_equal); - for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { + for (t_HE = hv_iternext(components); t_HE != NULL; + t_HE = hv_iternext(components)) { t_key = hv_iterkey(t_HE, &len); - t_SV = *hv_fetch(t_HV, t_key, len, 0); - t_value = SvPVutf8_nolen(t_SV); + t_SV = *hv_fetch(components, t_key, len, 0); + t_value = SvPVutf8_nolen(t_SV); g_hash_table_insert(t_GHash, t_key, t_value); } - serv_join_chat(con, t_GHash); + serv_join_chat(conn, t_GHash); void serv_move_buddy(buddy, group1, group2)