From f42d591845e1f7edb0070510d05195dfeca6d6dd Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Mon, 3 Feb 2020 16:51:57 +0100 Subject: [PATCH] sizeof --- slsDetectorSoftware/src/DetectorImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index c264682a4..b9de65966 100755 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -183,8 +183,8 @@ void DetectorImpl::initializeMembers(bool verify) { void DetectorImpl::updateUserdetails() { multi_shm()->lastPID = getpid(); - memset(multi_shm()->lastUser, 0, SHORT_STRING_LENGTH); - memset(multi_shm()->lastDate, 0, SHORT_STRING_LENGTH); + memset(multi_shm()->lastUser, 0, sizeof(multi_shm()->lastUser)); + memset(multi_shm()->lastDate, 0, sizeof(multi_shm()->lastDate)); try { sls::strcpy_safe(multi_shm()->lastUser, exec("whoami").c_str()); sls::strcpy_safe(multi_shm()->lastDate, exec("date").c_str());