Fix compiler warnings.
[oweals/tinc.git] / src / control.c
index 76f262e2c390ae2a49266238805e9ce9886062bc..beda6c41c0e27b2008a7c6e36caca7eb4486011e 100644 (file)
@@ -201,6 +201,8 @@ bool init_control(void) {
 
        strncpy(sa_un.sun_path, unixsocketname, sizeof(sa_un.sun_path));
 
+       sa_un.sun_path[sizeof(sa_un.sun_path) - 1] = 0;
+
        if(connect(unix_fd, (struct sockaddr *)&sa_un, sizeof(sa_un)) >= 0) {
                logger(DEBUG_ALWAYS, LOG_ERR, "UNIX socket %s is still in use!", unixsocketname);
                return false;