Fix a couple of infinite loops

This commit is contained in:
Kovid Goyal
2023-07-02 11:44:22 +05:30
parent eabebbc932
commit 4341599ac3
2 changed files with 3 additions and 4 deletions

View File

@@ -337,9 +337,8 @@ func split_for_transfer(data []byte, file_id string, mark_last bool, callback fu
chunk := data
if len(chunk) > chunk_size {
chunk = data[:chunk_size]
data = data[chunk_size:]
}
callback(&FileTransmissionCommand{Action: ac, File_id: file_id, Data: chunk})
data = data[len(chunk):]
}
}