aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/setconf.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-02-14 23:21:11 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-02-14 23:21:11 +0100
commit186272048dbc32e79226ed194b153030d0453f27 (patch)
tree5c2501070e83dfb7a791adbb48ecd3562e0df40c /src/setconf.c
parentwg-quick: match from beginning rather than shift right (diff)
downloadwireguard-tools-186272048dbc32e79226ed194b153030d0453f27.tar.xz
wireguard-tools-186272048dbc32e79226ed194b153030d0453f27.zip
wg: normalize strncpy/snprintf usage
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/setconf.c')
-rw-r--r--src/setconf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/setconf.c b/src/setconf.c
index b5b3cfb..f146a48 100644
--- a/src/setconf.c
+++ b/src/setconf.c
@@ -48,7 +48,7 @@ int setconf_main(int argc, char *argv[])
goto cleanup;
}
strncpy(device->name, argv[1], IFNAMSIZ - 1);
- device->name[IFNAMSIZ - 1] = 0;
+ device->name[IFNAMSIZ - 1] = '\0';
if (ipc_set_device(device) != 0) {
perror("Unable to set device");