changeset 24638:68a90c95b722

Tweak a few for loop conditions in the Perl bindings per Etan's suggestion. References #7687.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Thu, 11 Dec 2008 06:48:25 +0000
parents 08b65145276a
children 0e397f185166
files libpurple/plugins/perl/common/Account.xs libpurple/plugins/perl/common/AccountOpts.xs libpurple/plugins/perl/common/Conversation.xs libpurple/plugins/perl/common/Prefs.xs libpurple/plugins/perl/common/Roomlist.xs libpurple/plugins/perl/common/Status.xs pidgin/plugins/perl/common/GtkIMHtml.xs
diffstat 7 files changed, 19 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/common/Account.xs	Thu Dec 11 06:38:23 2008 +0000
+++ b/libpurple/plugins/perl/common/Account.xs	Thu Dec 11 06:48:25 2008 +0000
@@ -107,7 +107,7 @@
     t_GL = NULL;
     t_len = av_len((AV *)SvRV(status_types)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(status_types), i, 0)));
 
     purple_account_set_status_types(account, t_GL);
@@ -209,7 +209,7 @@
     t_GL = NULL;
     t_len = av_len((AV *)SvRV(list)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(list), i, 0)));
 
     purple_account_add_buddies(account, t_GL);
@@ -238,13 +238,13 @@
     t_GL1 = NULL;
     t_len = av_len((AV *)SvRV(A)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL1 = g_list_append(t_GL1, SvPVutf8_nolen(*av_fetch((AV *)SvRV(A), i, 0)));
 
     t_GL2 = NULL;
     t_len = av_len((AV *)SvRV(B)) + 1;
 
-    for (i = 0; i < t_len; i++)
+    for (i = 0; i <= t_len; i++)
         t_GL2 = g_list_append(t_GL2, SvPVutf8_nolen(*av_fetch((AV *)SvRV(B), i, 0)));
 
     purple_account_remove_buddies(account, t_GL1, t_GL2);
--- a/libpurple/plugins/perl/common/AccountOpts.xs	Thu Dec 11 06:38:23 2008 +0000
+++ b/libpurple/plugins/perl/common/AccountOpts.xs	Thu Dec 11 06:48:25 2008 +0000
@@ -44,7 +44,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(values)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(values), i, 0)));
 
 	RETVAL  = purple_account_option_list_new(text, pref_name, t_GL);
@@ -132,7 +132,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(values)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(values), i, 0)));
 
 	purple_account_option_set_list(option, t_GL);
--- a/libpurple/plugins/perl/common/Conversation.xs	Thu Dec 11 06:38:23 2008 +0000
+++ b/libpurple/plugins/perl/common/Conversation.xs	Thu Dec 11 06:48:25 2008 +0000
@@ -336,7 +336,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(users)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(users), i, 0)));
 
 	for (l = purple_conv_chat_set_users(chat, t_GL); l != NULL; l = l->next) {
@@ -374,7 +374,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(ignored)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(ignored), i, 0)));
 
 	for (l = purple_conv_chat_set_ignored(chat, t_GL); l != NULL; l = l->next) {
@@ -431,19 +431,19 @@
 	t_GL_users = NULL;
 	t_len = av_len((AV *)SvRV(users)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL_users = g_list_append(t_GL_users, SvPVutf8_nolen(*av_fetch((AV *)SvRV(users), i, 0)));
 
 	t_GL_flags = NULL;
 	t_len = av_len((AV *)SvRV(flags)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL_flags = g_list_append(t_GL_flags, SvPVutf8_nolen(*av_fetch((AV *)SvRV(flags), i, 0)));
 
 	t_GL_extra_msgs = NULL;
 	t_len = av_len((AV *)SvRV(extra_msgs)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL_extra_msgs = g_list_append(t_GL_extra_msgs, SvPVutf8_nolen(*av_fetch((AV *)SvRV(extra_msgs), i, 0)));
 
 	purple_conv_chat_add_users(chat, t_GL_users, t_GL_extra_msgs, t_GL_flags, new_arrivals);
--- a/libpurple/plugins/perl/common/Prefs.xs	Thu Dec 11 06:38:23 2008 +0000
+++ b/libpurple/plugins/perl/common/Prefs.xs	Thu Dec 11 06:48:25 2008 +0000
@@ -53,7 +53,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_add_string_list(name, t_GL);
@@ -75,7 +75,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_add_path_list(name, t_GL);
@@ -204,7 +204,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_set_string_list(name, t_GL);
@@ -226,7 +226,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(value)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
 
 	purple_prefs_set_path_list(name, t_GL);
--- a/libpurple/plugins/perl/common/Roomlist.xs	Thu Dec 11 06:38:23 2008 +0000
+++ b/libpurple/plugins/perl/common/Roomlist.xs	Thu Dec 11 06:48:25 2008 +0000
@@ -80,7 +80,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(fields)) + 1;
 
-	for (i = 0; i < t_len; i++)
+	for (i = 0; i <= t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(fields), i, 0)));
 
 	purple_roomlist_set_fields(list, t_GL);
--- a/libpurple/plugins/perl/common/Status.xs	Thu Dec 11 06:38:23 2008 +0000
+++ b/libpurple/plugins/perl/common/Status.xs	Thu Dec 11 06:48:25 2008 +0000
@@ -85,7 +85,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(source_list)) + 1;
 
-	for (i = 0; i < t_len; i++) {
+	for (i = 0; i <= t_len; i++) {
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(source_list), i, 0)));
 	}
 	purple_presence_add_list(presence, t_GL);
@@ -381,7 +381,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(status_types)) + 1;
 
-	for (i = 0; i < t_len; i++) {
+	for (i = 0; i <= t_len; i++) {
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(status_types), i, 0)));
 	}
 	RETVAL = (PurpleStatusType *)purple_status_type_find_with_id(t_GL, id);
--- a/pidgin/plugins/perl/common/GtkIMHtml.xs	Thu Dec 11 06:38:23 2008 +0000
+++ b/pidgin/plugins/perl/common/GtkIMHtml.xs	Thu Dec 11 06:48:25 2008 +0000
@@ -173,7 +173,7 @@
 	t_GL = NULL;
 	t_len = av_len((AV *)SvRV(unused)) + 1;
 
-	for (i = 0; i < t_len; i++) {
+	for (i = 0; i <= t_len; i++) {
 		STRLEN t_sl;
 		t_GL = g_slist_append(t_GL, SvPV(*av_fetch((AV *)SvRV(unused), i, 0), t_sl));
 	}