changeset 18175:038c14fcadb8

setting error to NULL before using
author Michael Shkutkov <mshkutkov@soc.pidgin.im>
date Thu, 21 Jun 2007 22:07:53 +0000
parents bb228f608b61
children b14dfa2f49a1
files libpurple/plugins/log_reader.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/log_reader.c	Thu Jun 21 22:03:51 2007 +0000
+++ b/libpurple/plugins/log_reader.c	Thu Jun 21 22:07:53 2007 +0000
@@ -1813,6 +1813,7 @@
 	purple_debug(PURPLE_DEBUG_INFO, "QIP logger list",
 		"Reading %s\n", path);
 	
+	error = NULL:
 	if (!g_file_get_contents(path, &contents, &length, &error)) 
 		if (error) {
 			purple_debug(PURPLE_DEBUG_ERROR, "QIP logger list",
@@ -1829,6 +1830,7 @@
 			"File %s is found\n", filename);
 			
 		/* We should convert file contents from Cp1251 to UTF-8 codeset */
+		error = NULL;
 		if (!(utf8_string = g_convert(contents, length, "UTF-8", "Cp1251", NULL, NULL, &error))) {
 			if (error) {
 				purple_debug(PURPLE_DEBUG_ERROR, "QIP logger list",
@@ -1935,6 +1937,7 @@
 	purple_debug(PURPLE_DEBUG_INFO, "QIP logger read",
 				"Reading %s\n", data->path);
 	
+	error = NULL;
 	if (!g_file_get_contents(data->path, &contents, &length, &error)) 
 		if (error) {
 			purple_debug(PURPLE_DEBUG_ERROR, "QIP logger list",
@@ -1946,6 +1949,7 @@
 		gchar * utf8_string;
 		
 		/* We should convert file contents from Cp1251 to UTF-8 codeset */
+		error = NULL;
 		if (!(utf8_string = g_convert (contents, length, "UTF-8", "Cp1251", NULL, NULL, &error))) {
 			if (error) {
 				purple_debug(PURPLE_DEBUG_ERROR, "QIP logger read",
@@ -2265,6 +2269,8 @@
 
 		purple_debug(PURPLE_DEBUG_INFO, "Trillian talk.ini read",
 				"Reading %s\n", path);
+				
+		error = NULL;
 		if (!g_key_file_load_from_file(key_file, path, G_KEY_FILE_NONE, GError &error)) {
 			purple_debug(PURPLE_DEBUG_ERROR, "Trillian talk.ini read",
 					"Error reading talk.ini\n");