Commit 74646130 authored by Filip Roséen's avatar Filip Roséen Committed by Rémi Denis-Courmont

network/httpd: use designated initializers for struct iovec

Given that POSIX does not guarantee the order (nor the number) of the
data-members within "struct iovec", we should either use designated
initializers, or direct member-access, to initialize struct iovec.{iov_base,
iov_len}.

--

See the below:

 - http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_uio.h.htmlSigned-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 427f2e4d
......@@ -1241,7 +1241,7 @@ static
ssize_t httpd_NetRecv (httpd_client_t *cl, uint8_t *p, size_t i_len)
{
vlc_tls_t *sock = cl->sock;
struct iovec iov = { p, i_len };
struct iovec iov = { .iov_base = p, .iov_len = i_len };
return sock->readv(sock, &iov, 1);
}
......@@ -1249,7 +1249,7 @@ static
ssize_t httpd_NetSend (httpd_client_t *cl, const uint8_t *p, size_t i_len)
{
vlc_tls_t *sock = cl->sock;
const struct iovec iov = { (void *)p, i_len };
const struct iovec iov = { .iov_base = (void *)p, .iov_len = i_len };
return sock->writev(sock, &iov, 1);
}
......
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