Mark more pointer arguments as never being null.

This commit is contained in:
Nicholas J. Kain 2015-02-14 01:46:02 -05:00
parent 0535b36534
commit 00c9479c4c
2 changed files with 5 additions and 4 deletions

View File

@ -343,7 +343,7 @@ void stop_dhcp_listen(struct client_state_t cs[static 1])
static int validate_dhcp_packet(struct client_state_t cs[static 1],
size_t len, struct dhcpmsg packet[static 1],
uint8_t *msgtype)
uint8_t msgtype[static 1])
{
if (len < offsetof(struct dhcpmsg, options)) {
log_warning("%s: Packet is too short to contain magic cookie. Ignoring.",

View File

@ -75,8 +75,9 @@ static int overload_value(const struct dhcpmsg packet[static 1])
return ol; // ol == 0
}
static void do_get_dhcp_opt(const uint8_t *sbuf, ssize_t slen, uint8_t code,
uint8_t *dbuf, ssize_t dlen, ssize_t *didx)
static void do_get_dhcp_opt(const uint8_t sbuf[static 1], ssize_t slen,
uint8_t code, uint8_t dbuf[static 1],
ssize_t dlen, ssize_t didx[static 1])
{
ssize_t i = 0;
while (i < slen) {
@ -102,7 +103,7 @@ static void do_get_dhcp_opt(const uint8_t *sbuf, ssize_t slen, uint8_t code,
}
ssize_t get_dhcp_opt(const struct dhcpmsg packet[static 1], uint8_t code,
uint8_t *dbuf, ssize_t dlen)
uint8_t dbuf[static 1], ssize_t dlen)
{
int ol = overload_value(packet);
ssize_t didx = 0;