From 5b07a1199c28d8a99b4800d26fb73a33a167b1a9 Mon Sep 17 00:00:00 2001 From: Romain Moret Date: Tue, 21 May 2019 15:07:00 +0200 Subject: [PATCH] Fix compiler error --- src/thread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thread.cpp b/src/thread.cpp index cf0567b6..ed355b30 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -58,7 +58,7 @@ void zmq::thread_t::start (thread_fn *tfn_, void *arg_, const char *name_) _tfn = tfn_; _arg = arg_; if (name_) - strncpy (_name, name_, sizeof (_name)); + strncpy (_name, name_, sizeof (_name) - 1); #if defined _WIN32_WCE _descriptor = (HANDLE) CreateThread (NULL, 0, &::thread_routine, this, 0, NULL); @@ -232,7 +232,7 @@ void zmq::thread_t::start (thread_fn *tfn_, void *arg_, const char *name_) _tfn = tfn_; _arg = arg_; if (name_) - strncpy (_name, name_, sizeof (_name)); + strncpy (_name, name_, sizeof (_name) - 1); int rc = pthread_create (&_descriptor, NULL, thread_routine, this); posix_assert (rc); _started = true;