From a5a7f08c374d008e7b674d624952f6f75b918f7a Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Fri, 3 Jul 2020 14:41:08 -0700 Subject: [PATCH] bifcl: Fix stringop-truncation compiler warning --- tools/bifcl/builtin-func.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bifcl/builtin-func.l b/tools/bifcl/builtin-func.l index e08c1b1505..2382da0f24 100644 --- a/tools/bifcl/builtin-func.l +++ b/tools/bifcl/builtin-func.l @@ -246,7 +246,7 @@ void init_alternative_mode() fprintf(fp_func_def, "\n"); static char name[1024]; - strncpy(name, input_filename, sizeof(name)); + strncpy(name, input_filename, sizeof(name) - 1); char* dot = strchr(name, '.'); if ( dot ) *dot = '\0'; @@ -254,7 +254,7 @@ void init_alternative_mode() if ( plugin ) { static char plugin_canon[1024]; - strncpy(plugin_canon, plugin, sizeof(plugin_canon)); + strncpy(plugin_canon, plugin, sizeof(plugin_canon) - 1); char* colon = strstr(plugin_canon, "::"); if ( colon ) {