1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 06:16:44 +02:00

properly close file senders on exit

This commit is contained in:
Jfreegman
2014-06-28 12:55:05 -04:00
parent 8d4f7fc32b
commit f8998b5891
4 changed files with 28 additions and 19 deletions

View File

@ -385,7 +385,7 @@ static void chat_onFileData(ToxWindow *self, Tox *m, int32_t num, uint8_t filenu
FILE *fp = friends[num].file_receiver.files[filenum];
if (fp) {
if (fwrite(data, length, 1, friends[num].file_receiver.files[filenum]) != 1) {
if (fwrite(data, length, 1, fp) != 1) {
uint8_t *msg = " * Error writing to file.";
line_info_add(self, NULL, NULL, NULL, msg, SYS_MSG, 0, RED);