From c6c8a23c0213202c5e0c3cfb3bfd983480358209 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 24 Apr 2020 18:03:00 -0400 Subject: [PATCH] sun_path is defined to be 108 bytes. No need for 4095. Quiets compiler warnings --- src/zm_stream.cpp | 2 +- src/zm_stream.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp index d355ef4c2..587c01ebf 100644 --- a/src/zm_stream.cpp +++ b/src/zm_stream.cpp @@ -349,7 +349,7 @@ void StreamBase::openComms() { } snprintf(rem_sock_path, sizeof(rem_sock_path), "%s/zms-%06dw.sock", staticConfig.PATH_SOCKS.c_str(), connkey); - strncpy(rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path)-1); + strncpy(rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path)); rem_addr.sun_family = AF_UNIX; gettimeofday(&last_comm_update, NULL); diff --git a/src/zm_stream.h b/src/zm_stream.h index 9adedb9ab..c7984a1af 100644 --- a/src/zm_stream.h +++ b/src/zm_stream.h @@ -78,11 +78,11 @@ protected: bool send_objdetect; int connkey; int sd; - char loc_sock_path[PATH_MAX]; + char loc_sock_path[108]; struct sockaddr_un loc_addr; - char rem_sock_path[PATH_MAX]; + char rem_sock_path[108]; struct sockaddr_un rem_addr; - char sock_path_lock[PATH_MAX]; + char sock_path_lock[108]; int lock_fd; bool paused; int step;