prefer sizeof(x) instead of datalen

This commit is contained in:
Omar Polo 2022-03-27 12:52:58 +00:00
parent 62a46b03c6
commit 6084a9a5ba
1 changed files with 2 additions and 2 deletions

4
ex.c
View File

@ -288,7 +288,7 @@ handle_imsg_cgi_req(struct imsgbuf *ibuf, struct imsg *imsg, size_t datalen)
if (datalen != sizeof(req))
abort();
memcpy(&req, imsg->data, datalen);
memcpy(&req, imsg->data, sizeof(req));
iri.schema = req.iri_schema_off + req.buf;
iri.host = req.iri_host_off + req.buf;
@ -409,7 +409,7 @@ handle_imsg_fcgi_req(struct imsgbuf *ibuf, struct imsg *imsg, size_t datalen)
if (datalen != sizeof(id))
abort();
memcpy(&id, imsg->data, datalen);
memcpy(&id, imsg->data, sizeof(id));
if (id > FCGI_MAX || (fcgi[id].path == NULL && fcgi[id].prog == NULL))
abort();