From a91ce74ddcf2ff410515b794273cf070e7d4a4ac Mon Sep 17 00:00:00 2001 From: codemaestro Date: Sat, 18 Oct 2025 12:30:03 +0530 Subject: [PATCH] tdf#163691: Use std::copy() instead of memcpy() Change-Id: Ic1d849400c01276b8b9cf09d370f0aed635b71dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192606 Tested-by: Jenkins Reviewed-by: Hossein --- hwpfilter/source/grammar.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx index 199aab343208..27fba248bb58 100644 --- a/hwpfilter/source/grammar.cxx +++ b/hwpfilter/source/grammar.cxx @@ -404,9 +404,9 @@ yynewstate: yystacksize = YYMAXDEPTH; yyfree_stacks = 1; yyss = static_cast(malloc (yystacksize * sizeof (*yyssp))); - memcpy (yyss, yyss1, size * sizeof (*yyssp)); + std::copy(yyss1, yyss1 + size, yyss); yyvs = static_cast(malloc (yystacksize * sizeof (*yyvsp))); - memcpy (yyvs, yyvs1, size * sizeof (*yyvsp)); + std::copy(yyvs1, yyvs1 + size, yyvs); // https://lists.gnu.org/archive/html/bug-bison/2001-11/msg00021.html if (yyss1 != yyssa)