diff --git a/CMakeLists.txt b/CMakeLists.txt index fcd41403a..c34ac350c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ # For more information and installation, see the INSTALL file # cmake_minimum_required (VERSION 2.8.7) -cmake_policy(SET CMP0054 NEW) project (zoneminder) file (STRINGS "version" zoneminder_VERSION) # make API version a minor of ZM version diff --git a/src/zm_utils.cpp b/src/zm_utils.cpp index b97e3a3b5..de37dfee8 100644 --- a/src/zm_utils.cpp +++ b/src/zm_utils.cpp @@ -393,12 +393,12 @@ void timespec_diff(struct timespec *start, struct timespec *end, struct timespec char *timeval_to_string( struct timeval tv ) { time_t nowtime; struct tm *nowtm; - static char tmbuf[64], buf[64]; + static char tmbuf[20], buf[28]; nowtime = tv.tv_sec; nowtm = localtime(&nowtime); strftime(tmbuf, sizeof tmbuf, "%Y-%m-%d %H:%M:%S", nowtm); - snprintf(buf, sizeof buf, "%s.%06ld", tmbuf, tv.tv_usec); + snprintf(buf, sizeof buf-1, "%s.%06ld", tmbuf, tv.tv_usec); return buf; }