Fixed warnings.

This commit is contained in:
irungentoo 2013-10-05 11:24:30 -04:00
parent ac117322a9
commit 97f192969c
2 changed files with 6 additions and 3 deletions

View File

@ -662,7 +662,7 @@ void file_request_accept(Tox *m, int friendnumber, uint8_t filenumber, uint64_t
uint16_t filename_length, void *userdata)
{
char msg[512];
sprintf(msg, "[t] %u is sending us: %s of size %llu", friendnumber, filename, filesize);
sprintf(msg, "[t] %u is sending us: %s of size %llu", friendnumber, filename, (long long unsigned int)filesize);
new_lines(msg);
if (tox_file_sendcontrol(m, friendnumber, 1, filenumber, 0, 0, 0)) {
@ -701,7 +701,9 @@ void write_file(Tox *m, int friendnumber, uint8_t filenumber, uint8_t *data, uin
new_lines(msg);
}
fwrite(data, length, 1, pFile);
if (fwrite(data, length, 1, pFile) != 1)
new_lines("Error writing to file");
fclose(pFile);
}

View File

@ -184,7 +184,8 @@ void file_print_control(Tox *m, int friendnumber, uint8_t recieve_send, uint8_t
void write_file(Tox *m, int friendnumber, uint8_t filenumber, uint8_t *data, uint16_t length, void *userdata)
{
if (file_recv[filenumber].file != 0)
fwrite(data, length, 1, file_recv[filenumber].file);
if (fwrite(data, length, 1, file_recv[filenumber].file) != 1)
printf("Error writing data\n");
}
void print_online(Tox *tox, int friendnumber, uint8_t status, void *userdata)