From 668292332041a0bcfd921e36e09f02ee34d06787 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Sat, 11 Oct 2014 13:53:53 +0200 Subject: [PATCH] [SQUASH ME] netdev.802154: fix type error --- drivers/cc2420/cc2420.c | 3 ++- drivers/netdev/802154/802154.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cc2420/cc2420.c b/drivers/cc2420/cc2420.c index 16de7d29c9181..962dab6c98e91 100644 --- a/drivers/cc2420/cc2420.c +++ b/drivers/cc2420/cc2420.c @@ -418,7 +418,7 @@ int cc2420_get_option(netdev_t *dev, netdev_opt_t opt, void *value, *value_len = sizeof(size_t); } - *((size_t)value) = _default_src_addr_len; + *((size_t *)value) = _default_src_addr_len; default: return -ENOTSUP; @@ -664,6 +664,7 @@ int cc2420_set_option(netdev_t *dev, netdev_opt_t opt, void *value, if ((res = _type_pun_up_unsigned(set_value, sizeof(size_t), value, value_len)) == 0) { size_t *v = (size_t *)set_value; + if (*v != 2 || *v != 8) { return -EINVAL; } diff --git a/drivers/netdev/802154/802154.c b/drivers/netdev/802154/802154.c index 079ef79dc8353..f2cf538aabbee 100644 --- a/drivers/netdev/802154/802154.c +++ b/drivers/netdev/802154/802154.c @@ -34,7 +34,7 @@ static size_t _get_src_len(netdev_t *dev) { size_t src_len, src_len_len = sizeof(size_t); - if (_get_driver(dev)->get_option(dev, NETDEV_OPT_SRC_LEN, &src_len, src_len_len) < 0) { + if (_get_driver(dev)->get_option(dev, NETDEV_OPT_SRC_LEN, &src_len, &src_len_len) < 0) { return 2; }