aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Bretelle <chantra@debuntu.org>2010-09-07 18:02:10 +0200
committerHarald Welte <laforge@gnumonks.org>2010-10-20 11:04:51 +0200
commiteaaf50095b396e1372e42cb30672fdf038692275 (patch)
treec4bfce0fbd318d6a5fabb96ae4ef5563a2018224
parent2a103687b6c08c95b96ccf447ef096bc7e54d7ae (diff)
Set tun devname to IFNAMESIZ+1 to avoid warning
Relevant output from make: ../lib/tun.c: In function ‘tun_new’: ../lib/tun.c:688: warning: array subscript is above array bounds Caused by assignement: (*tun)->devname[IFNAMSIZ] = 0; while devname defined as: char devname[IFNAMSIZ]; Signed-off-by: Emmanuel Bretelle <chantra@debuntu.org>
-rw-r--r--lib/tun.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tun.h b/lib/tun.h
index 7972c53..714144a 100644
--- a/lib/tun.h
+++ b/lib/tun.h
@@ -45,7 +45,7 @@ struct tun_t {
struct in_addr netmask;
int addrs; /* Number of allocated IP addresses */
int routes; /* One if we allocated an automatic route */
- char devname[IFNAMSIZ];/* Name of the tun device */
+ char devname[IFNAMSIZ+1];/* Name of the tun device */
int (*cb_ind) (struct tun_t *tun, void *pack, unsigned len);
};