From: John David Anglin Date: Fri, 19 Mar 2021 15:57:06 +0000 (+0000) Subject: Use memcpy instead of strncpy to avoid error with -Werror=stringop-truncation. X-Git-Tag: basepoints/gcc-12~520 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22d1a90a1526a77585333bd6c7d9bfc1a9cbdffa;p=thirdparty%2Fgcc.git Use memcpy instead of strncpy to avoid error with -Werror=stringop-truncation. gcc/ChangeLog: * config/pa/pa.c (import_milli): Use memcpy instead of strncpy. --- diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index d7fcd11e5046..46194ba395d1 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -5950,7 +5950,7 @@ import_milli (enum millicodes code) { imported[(int) code] = 1; strcpy (str, import_string); - strncpy (str + MILLI_START, milli_names[(int) code], 4); + memcpy (str + MILLI_START, milli_names[(int) code], 4); output_asm_insn (str, 0); } }