Fix size_t incorrectly assigned to int

The function control_msg_serialize() returns a size_t.
This commit is contained in:
Romain Vimont 2021-01-17 14:22:23 +01:00
parent 8dbb1676b7
commit 94eff0a4bb
2 changed files with 14 additions and 14 deletions

View file

@ -60,12 +60,12 @@ static bool
process_msg(struct controller *controller,
const struct control_msg *msg) {
static unsigned char serialized_msg[CONTROL_MSG_MAX_SIZE];
int length = control_msg_serialize(msg, serialized_msg);
size_t length = control_msg_serialize(msg, serialized_msg);
if (!length) {
return false;
}
int w = net_send_all(controller->control_socket, serialized_msg, length);
return w == length;
return (size_t) w == length;
}
static int