Skip to content

Commit

Permalink
drivers/sx127x/sx127x_netdev.c: fix var size
Browse files Browse the repository at this point in the history
  • Loading branch information
kYc0o committed Oct 26, 2017
1 parent d6e6fea commit dd9f038
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/sx127x/sx127x_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
return sizeof(uint32_t);

case NETOPT_TX_POWER:
assert(len <= sizeof(uint8_t));
sx127x_set_tx_power(dev, *((const uint8_t*) val));
return sizeof(uint16_t);
assert(len <= sizeof(int8_t));
sx127x_set_tx_power(dev, *((const int8_t*) val));
return sizeof(int8_t);

case NETOPT_FIXED_HEADER:
assert(len <= sizeof(netopt_enable_t));
Expand Down Expand Up @@ -471,7 +471,7 @@ static uint8_t _get_tx_len(const struct iovec *vector, unsigned count)
{
uint8_t len = 0;

for (int i=0 ; i < count ; i++) {
for (unsigned i = 0 ; i < count ; i++) {
len += vector[i].iov_len;
}

Expand Down Expand Up @@ -694,4 +694,4 @@ void _on_dio3_irq(void *arg)
puts("sx127x_on_dio3: Unknown modem");
break;
}
}
}

0 comments on commit dd9f038

Please sign in to comment.