comparison src/log.c @ 8370:2279bfa6aa59

[gaim-migrate @ 9097] Thou shalt fclose thy file or thou shalt crash. Hard. After 4 or so successive searches or. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 29 Feb 2004 19:40:56 +0000
parents 869d5a5495b8
children 13a65fd6a932
comparison
equal deleted inserted replaced
8369:27c0cb0d8d07 8370:2279bfa6aa59
880 struct old_logger_data *data = log->logger_data; 880 struct old_logger_data *data = log->logger_data;
881 FILE *file = fopen(gaim_stringref_value(data->pathref), "rb"); 881 FILE *file = fopen(gaim_stringref_value(data->pathref), "rb");
882 char *read = g_malloc(data->length + 1); 882 char *read = g_malloc(data->length + 1);
883 fseek(file, data->offset, SEEK_SET); 883 fseek(file, data->offset, SEEK_SET);
884 fread(read, data->length, 1, file); 884 fread(read, data->length, 1, file);
885 fclose(file);
885 read[data->length] = '\0'; 886 read[data->length] = '\0';
886 *flags = 0; 887 *flags = 0;
887 if(strstr(read, "<BR>")) 888 if(strstr(read, "<BR>"))
888 *flags |= GAIM_LOG_READ_NO_NEWLINE; 889 *flags |= GAIM_LOG_READ_NO_NEWLINE;
889 return read; 890 return read;