From 0e50a4c0086b628ce76de2156d33133595703082 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 23 Oct 2015 12:07:16 +0200 Subject: [PATCH] correct snprintf usage --- TSRM/tsrm_win32.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index e8ec18650a..466d2f27b2 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -599,10 +599,8 @@ TSRM_API int shmget(int key, int size, int flags) return -1; } - snprintf(shm_segment, sizeof(shm_segment)-1, "TSRM_SHM_SEGMENT:%d", key); - snprintf(shm_info, sizeof(shm_info)-1, "TSRM_SHM_DESCRIPTOR:%d", key); - shm_segment[sizeof(shm_segment)-1] = '\0'; - shm_info[sizeof(shm_info)-1] = '\0'; + snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key); + snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key); shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment); info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info); -- 2.40.0