From fe0ccf52e9c4f092fef8d1999d94a9cc3eae4982 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Fri, 18 Oct 2013 22:18:48 -0400 Subject: [PATCH] small fix --- src/chat.c | 2 +- src/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chat.c b/src/chat.c index 8cec8de..156e0e5 100644 --- a/src/chat.c +++ b/src/chat.c @@ -136,7 +136,7 @@ static void chat_onFileSendRequest(ToxWindow *self, Tox *m, int num, uint8_t fil uint8_t cur_time[MAX_STR_SIZE]; snprintf(cur_time, sizeof(cur_time), ".%02d:%02d:%02d", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); - strncat(filename, cur_time, MAX_STR_SIZE); + strncat(filename, cur_time, MAX_STR_SIZE - strlen(filename)); fclose(filecheck); } diff --git a/src/main.c b/src/main.c index ccc7263..9971c4f 100644 --- a/src/main.c +++ b/src/main.c @@ -352,7 +352,7 @@ void do_file_senders(Tox *m) int i; for (i = 0; i < MAX_FILES; ++i) { - if (file_senders[i].file == NULL) + if (!file_senders[i].active) continue; while (true) {