From eecb2e77b676100bbdac2dbd0cd82bcd44dc29e3 Mon Sep 17 00:00:00 2001 From: harry Date: Sun, 9 Jun 2024 14:07:41 -0400 Subject: [PATCH] Replace strncpy usage in favor of Strlcpy to get rid of compiler warnings. --- src/ld65dbg.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ld65dbg.cpp b/src/ld65dbg.cpp index 7e93417d4..1ae2ca131 100644 --- a/src/ld65dbg.cpp +++ b/src/ld65dbg.cpp @@ -6,6 +6,7 @@ #include "types.h" #include "ld65dbg.h" +#include "utils/StringUtils.h" namespace ld65 @@ -304,7 +305,7 @@ namespace ld65 } else if ( strcmp( key, "name") == 0 ) { - strncpy( name, val, sizeof(name)); + Strlcpy( name, val, sizeof(name)); } else if ( strcmp( key, "size") == 0 ) { @@ -332,7 +333,7 @@ namespace ld65 } else if ( strcmp( key, "type") == 0 ) { - strncpy( type, val, sizeof(type)); + Strlcpy( type, val, sizeof(type)); } }