From ef0ab3d8c337790738d4dfd807e7126c7ea5c099 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 31 Oct 2023 19:36:01 +0100 Subject: [PATCH] Avoid GCC's stringop-truncation warning Not copying the termination character here is wanted. Just use `std::memcpy` to avoid it as the special behavior of `std::strncpy` is not needed here anyways. --- id3/id3v2frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/id3/id3v2frame.cpp b/id3/id3v2frame.cpp index 84b7050..54bef27 100644 --- a/id3/id3v2frame.cpp +++ b/id3/id3v2frame.cpp @@ -1172,7 +1172,7 @@ void Id3v2Frame::makeLegacyPicture( } else { imageFormat = "UND"; } - std::strncpy(++offset, imageFormat, 3); + std::memcpy(++offset, imageFormat, 3); // write picture type *(offset += 3) = static_cast(typeInfo);