mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-08-04 21:16:21 +00:00
Fixed history when no log
This commit is contained in:
@@ -101,6 +101,7 @@ chat_log_get_previous(const gchar * const login, gchar *recipient,
|
||||
FILE *logp = fopen(filename, "r");
|
||||
char *line = NULL;
|
||||
size_t read = 0;
|
||||
if (logp != NULL) {
|
||||
size_t length = getline(&line, &read, logp);
|
||||
while (length != -1) {
|
||||
char *copy = malloc(length);
|
||||
@@ -112,6 +113,7 @@ chat_log_get_previous(const gchar * const login, gchar *recipient,
|
||||
read = 0;
|
||||
length = getline(&line, &read, logp);
|
||||
}
|
||||
}
|
||||
|
||||
free(filename);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user