mirror of
https://github.com/Tha14/toxic.git
synced 2024-12-24 01:03:27 +01:00
Merge pull request #128 from aitjcize/null-term
Fix file sender null terminator.
This commit is contained in:
commit
af09961875
@ -228,6 +228,8 @@ static void chat_onFileSendRequest(ToxWindow *self, Tox *m, int32_t num, uint8_t
|
||||
uint8_t msg[MAX_STR_SIZE];
|
||||
uint8_t *errmsg;
|
||||
|
||||
pathname[path_len] = '\0';
|
||||
|
||||
uint8_t filename[MAX_STR_SIZE];
|
||||
get_file_name(pathname, filename);
|
||||
|
||||
|
@ -247,7 +247,7 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv
|
||||
|
||||
uint8_t filename[MAX_STR_SIZE];
|
||||
get_file_name(path, filename);
|
||||
int filenum = tox_new_file_sender(m, self->num, filesize, filename, strlen(filename) + 1);
|
||||
int filenum = tox_new_file_sender(m, self->num, filesize, filename, strlen(filename));
|
||||
|
||||
if (filenum == -1) {
|
||||
errmsg = "Error sending file.";
|
||||
|
Loading…
Reference in New Issue
Block a user