diff options
author | sin <sin@2f30.org> | 2014-09-15 14:23:17 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-09-15 14:23:17 +0100 |
commit | 26bb4f4a75d9561bd68a92fce7827a3c7cbae0d4 (patch) | |
tree | 54478d74e4c43f02a1b4de6867e3f4c5c8d5e55f | |
parent | a9a7f5fd2726e9b3e26a7878e1d89baa49cd215d (diff) |
friendcreate() should return a pointer to the friend
-rw-r--r-- | ratatox.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -80,7 +80,7 @@ static int toxinit(void); static int toxconnect(void); static void id2str(uint8_t *, uint8_t *); static void str2id(uint8_t *, uint8_t *); -static void friendcreate(int32_t); +static struct friend *friendcreate(int32_t); static void friendload(void); static int cmdrun(void); static int doaccept(char *, size_t); @@ -223,7 +223,7 @@ cb_conn_status(Tox *tox, int32_t fid, uint8_t status, void *udata) } } - friendcreate(fid); + f = friendcreate(fid); blabla(f, "online", "w", status == 0 ? "0\n" : "1\n"); } @@ -467,7 +467,7 @@ str2id(uint8_t *idstr, uint8_t *id) sscanf(p, "%2hhx", &id[i]); } -static void +static struct friend * friendcreate(int32_t fid) { FILE *fp; @@ -519,6 +519,8 @@ friendcreate(int32_t fid) blabla(f, "online", "w", "0\n"); TAILQ_INSERT_TAIL(&friendhead, f, entry); + + return f; } static void |