Commit adac1d17 authored by Ghislain MARY's avatar Ghislain MARY

Check return value of fwrite to prevent compilation errors.

parent afa02ac7
......@@ -278,11 +278,16 @@ static void belle_sip_file_body_handler_clone(belle_sip_file_body_handler_t *obj
static void belle_sip_file_body_handler_recv_chunk(belle_sip_body_handler_t *base, belle_sip_message_t *msg, size_t offset, const uint8_t *buf, size_t size) {
FILE *f;
int ret;
belle_sip_file_body_handler_t *obj = (belle_sip_file_body_handler_t *)base;
if (obj->filepath == NULL) return;
f = fopen(obj->filepath, "ab");
if (f == NULL) return;
fwrite(buf, 1, size, f);
ret = fwrite(buf, 1, size, f);
if (ret != size) {
fclose(f);
return;
}
fclose(f);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment