From a3a2d12213b6963afecf527aa132efe558ca8538 Mon Sep 17 00:00:00 2001 From: "Daniel T. Borelli" Date: Mon, 10 Jun 2019 11:04:55 -0300 Subject: [PATCH] Replace strncpy with memcpy. This solves the truncation compiler warning. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index e23c265..2e19fcc 100644 --- a/src/main.c +++ b/src/main.c @@ -199,9 +199,9 @@ void scrot_check_if_overwrite_file(char **filename) if (extension) // exclude extension - strncpy(newname, curfile, slen - 4); + memcpy(newname, curfile, slen - 4); else - strncpy(newname, curfile, slen); + memcpy(newname, curfile, slen); do { snprintf(fmt, 5, "_%03d", count++);