From e9a02968513e8d63f3e6d5cd15ccc35b598a9ccf Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Thu, 2 Oct 2014 22:25:21 -0400 Subject: [PATCH] ignore tox_load errors until toxcore is fixed --- src/friendlist.c | 8 ++++---- src/toxic.c | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/friendlist.c b/src/friendlist.c index 202ed73..05a17fa 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -138,7 +138,7 @@ static int save_blocklist(char *path) exit_toxic_err("Failed in save_blocklist", FATALERR_MEMORY); int i; - int ret = -1; + int count = 0; for (i = 0; i < Blocked.max_idx; ++i) { @@ -168,14 +168,14 @@ static int save_blocklist(char *path) goto on_error; if (fwrite(data, len, 1, fp) == 1) - ret = 0; + goto on_error; fclose(fp); - return ret; + return 0; on_error: free(data); - return ret; + return -1; } static void sort_blocklist_index(void); diff --git a/src/toxic.c b/src/toxic.c index 3ae24f7..3f6a418 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -690,11 +690,8 @@ static void load_data(Tox *m, char *path) } } } else { - if (tox_load(m, (uint8_t *) buf, len) != 0) { - fclose(fd); - free(buf); - exit_toxic_err("failed in load_data", FATALERR_FILEOP); - } + /* tox_load errors are to be ignored until toxcore is fixed */ + tox_load(m, (uint8_t *) buf, len); } load_friendlist(m);