Mercurial > pidgin.yaz
changeset 22068:a031a4fd6a7d
Part of a large patch from o_sukhodolsky to fix some build warnings.
Refs #1344
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 13 Jan 2008 20:48:56 +0000 |
parents | 3684c9d16f6f |
children | 150993c9d509 |
files | libpurple/log.c |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/log.c Sun Jan 13 20:46:18 2008 +0000 +++ b/libpurple/log.c Sun Jan 13 20:48:56 2008 +0000 @@ -1859,11 +1859,15 @@ static char * old_logger_read (PurpleLog *log, PurpleLogReadFlags *flags) { + size_t result; struct old_logger_data *data = log->logger_data; - FILE *file = g_fopen(purple_stringref_value(data->pathref), "rb"); + const char *path = purple_stringref_value(data->pathref); + FILE *file = g_fopen(path, "rb"); char *read = g_malloc(data->length + 1); fseek(file, data->offset, SEEK_SET); - fread(read, data->length, 1, file); + result = fread(read, data->length, 1, file); + if (result != 1) + purple_debug_error("log", "Unable to read from log file: %s\n", path); fclose(file); read[data->length] = '\0'; *flags = 0;