Skip to content
Snippets Groups Projects
Unverified Commit 521e9af9 authored by Nicolas Tsiftes's avatar Nicolas Tsiftes Committed by GitHub
Browse files

Merge pull request #1779 from pjonsson/gcc8-fixes

rpl-border-router: fix GCC 8 warnings
parents c6bf1bdb 8afc3b25
Branches
No related tags found
No related merge requests found
...@@ -175,7 +175,8 @@ PT_THREAD(handle_input(struct httpd_state *s)) ...@@ -175,7 +175,8 @@ PT_THREAD(handle_input(struct httpd_state *s))
s->filename[sizeof(s->filename) - 1] = '\0'; s->filename[sizeof(s->filename) - 1] = '\0';
} else { } else {
s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0; s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0;
strncpy(s->filename, s->inputbuf, sizeof(s->filename)); strncpy(s->filename, s->inputbuf, sizeof(s->filename) - 1);
s->filename[sizeof(s->filename) - 1] = '\0';
} }
#endif /* URLCONV */ #endif /* URLCONV */
......
...@@ -97,10 +97,11 @@ slip_config_handle_arguments(int argc, char **argv) ...@@ -97,10 +97,11 @@ slip_config_handle_arguments(int argc, char **argv)
case 't': case 't':
if(strncmp("/dev/", optarg, 5) == 0) { if(strncmp("/dev/", optarg, 5) == 0) {
strncpy(slip_config_tundev, optarg + 5, sizeof(slip_config_tundev)); strncpy(slip_config_tundev, optarg + 5, sizeof(slip_config_tundev) - 1);
} else { } else {
strncpy(slip_config_tundev, optarg, sizeof(slip_config_tundev)); strncpy(slip_config_tundev, optarg, sizeof(slip_config_tundev) - 1);
} }
slip_config_tundev[sizeof(slip_config_tundev) - 1] = '\0';
break; break;
case 'a': case 'a':
......
...@@ -165,7 +165,7 @@ tun_alloc(char *dev) ...@@ -165,7 +165,7 @@ tun_alloc(char *dev)
*/ */
ifr.ifr_flags = IFF_TUN | IFF_NO_PI; ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
if(*dev != 0) { if(*dev != 0) {
strncpy(ifr.ifr_name, dev, IFNAMSIZ); strncpy(ifr.ifr_name, dev, IFNAMSIZ - 1);
} }
if((err = ioctl(fd, TUNSETIFF, (void *)&ifr)) < 0) { if((err = ioctl(fd, TUNSETIFF, (void *)&ifr)) < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment