Mercurial > pidgin
diff libpurple/protocols/jabber/usermood.c @ 22819:42dfa1139b5c
merge of '21d37789f674809d615fc7676a092f1da438b0f5'
and 'aafbbc317ab5f69e31e0bb6cabc264bb70745ef2'
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Fri, 02 May 2008 22:51:14 +0000 |
parents | 5954c65ae4f4 |
children | 26eabe8e739b 5f9a24d1c25e 432d9176d054 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/usermood.c Fri May 02 22:50:13 2008 +0000 +++ b/libpurple/protocols/jabber/usermood.c Fri May 02 22:51:14 2008 +0000 @@ -147,7 +147,7 @@ static void do_mood_set_from_fields(PurpleConnection *gc, PurpleRequestFields *fields) { JabberStream *js; - int max_mood_idx; + const int max_mood_idx = sizeof(moodstrings) / sizeof(moodstrings[0]) - 1; int selected_mood = purple_request_fields_get_choice(fields, "mood"); if (!PURPLE_CONNECTION_IS_VALID(gc)) { @@ -157,9 +157,6 @@ js = gc->proto_data; - /* This is ugly, but protects us from unexpected values. */ - for (max_mood_idx = 0; moodstrings[max_mood_idx]; max_mood_idx++); - if (selected_mood < 0 || selected_mood >= max_mood_idx) { purple_debug_error("jabber", "Invalid mood index (%d) selected.\n", selected_mood); return;