1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-03 16:17:46 +02:00

Merge pull request #128 from aitjcize/null-term

Fix file sender null terminator.
This commit is contained in:
JFreegman 2014-05-05 15:41:09 -04:00
commit af09961875
2 changed files with 3 additions and 1 deletions

View File

@ -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);

View File

@ -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.";