im.pidgin.pidgin: e9e74094baa29c6f5589385507221a2502b817fb

sadrul at pidgin.im sadrul at pidgin.im
Fri Oct 12 18:25:37 EDT 2007


-----------------------------------------------------------------
Revision: e9e74094baa29c6f5589385507221a2502b817fb
Ancestor: 8152fe0104bfcc5da3dda8b81badd6f63f9532b8
Author: sadrul at pidgin.im
Date: 2007-10-12T22:26:44
Branch: im.pidgin.pidgin

Modified files:
        libpurple/plugins/log_reader.c

ChangeLog: 

Since we are looking at the return value of fread, it actually matters that
we use the correct values for the size of a single data item and the number
of items to read.

-------------- next part --------------
============================================================
--- libpurple/plugins/log_reader.c	94ce5d4de8a816ee88c17f9f1f4c4adc907011fc
+++ libpurple/plugins/log_reader.c	f937bcfd8babac0ce0b28d236fb0401900c1a72a
@@ -127,7 +127,7 @@ static GList *adium_logger_list(PurpleLo
 						continue;
 					}
 
-					rd = fread(contents, 56, 1, handle) == 0;
+					rd = fread(contents, 1, 56, handle) == 0;
 					fclose(handle);
 					contents[rd] = '\0';
 
@@ -189,7 +189,7 @@ static GList *adium_logger_list(PurpleLo
 						continue;
 					}
 
-					rd = fread(contents, 13, 1, handle);
+					rd = fread(contents, 1, 13, handle);
 					fclose(handle);
 					contents[rd] = '\0';
 
@@ -1423,7 +1423,7 @@ static char * trillian_logger_read (Purp
 
 	file = g_fopen(data->path, "rb");
 	fseek(file, data->offset, SEEK_SET);
-	data->length = fread(read, data->length, 1, file);
+	data->length = fread(read, 1, data->length, file);
 	fclose(file);
 
 	if (read[data->length-1] == '\n') {
@@ -1922,7 +1922,7 @@ static char *qip_logger_read(PurpleLog *
 	contents = g_malloc(data->length + 2);
 
 	fseek(file, data->offset, SEEK_SET);
-	data->length = fread(contents, data->length, 1, file);
+	data->length = fread(contents, 1, data->length, file);
 	fclose(file);
 
 	contents[data->length] = '\n';
@@ -2306,7 +2306,7 @@ static char *amsn_logger_read(PurpleLog 
 	g_return_val_if_fail(file != NULL, g_strdup(""));
 	
 	fseek(file, data->offset, SEEK_SET);
-	data->length = fread(contents, data->length, 1, file);
+	data->length = fread(contents, 1, data->length, file);
 	fclose(file);
 
 	contents[data->length] = '\n';


More information about the Commits mailing list