mirror of
https://github.com/Tha14/toxic.git
synced 2025-09-16 07:36:52 +02:00
Make sure we check for duplicate paths in pending file transfers list
This fixes a bug where if you receive multiple file transfer requests simultaneously and they have the same path the files will overwrite each other
This commit is contained in:
@@ -676,8 +676,10 @@ static void chat_onFileRecv(ToxWindow *self, Tox *m, uint32_t friendnum, uint32_
|
||||
FILE *filecheck = NULL;
|
||||
int count = 1;
|
||||
|
||||
while ((filecheck = fopen(file_path, "r"))) {
|
||||
fclose(filecheck);
|
||||
while ((filecheck = fopen(file_path, "r")) || file_transfer_recv_path_exists(file_path)) {
|
||||
if (filecheck) {
|
||||
fclose(filecheck);
|
||||
}
|
||||
|
||||
file_path[path_len] = '\0';
|
||||
char d[5];
|
||||
|
Reference in New Issue
Block a user