From 63a2a8d93675c0644d51d7afbf2312637bc48596 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 7 Jun 2020 03:35:03 +0000 Subject: Fix compiler warning git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3832 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libpm.c') diff --git a/lib/libpm.c b/lib/libpm.c index 47a2f498..bc922385 100644 --- a/lib/libpm.c +++ b/lib/libpm.c @@ -770,10 +770,10 @@ extractAfterLastSlash(const char * const fullPath, slashPos = strrchr(fullPath, '/'); if (slashPos == NULL) { - strncpy(retval, fullPath, retvalSize); + strncpy(retval, fullPath, retvalSize-1); retval[retvalSize-1] = '\0'; } else { - strncpy(retval, slashPos +1, retvalSize); + strncpy(retval, slashPos + 1, retvalSize-1); retval[retvalSize-1] = '\0'; } } -- cgit 1.4.1