From c933269d3a59e9a36587406ed2c130ea1b292852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Tue, 21 May 2024 12:36:11 +0200 Subject: [PATCH] qt: Avoid bogus stringop-overread warning * lang/qt/src/threadedjobmixin.cpp (_detail::audit_log_as_html): Use QByteArray overload of QString::fromUtf8. -- There's no need to make the code more complicated than necessary. Unless we want to provoke weird compiler warnings. :-) --- lang/qt/src/threadedjobmixin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lang/qt/src/threadedjobmixin.cpp b/lang/qt/src/threadedjobmixin.cpp index b7963c39..a1438a7f 100644 --- a/lang/qt/src/threadedjobmixin.cpp +++ b/lang/qt/src/threadedjobmixin.cpp @@ -98,8 +98,7 @@ QString _detail::audit_log_as_html(Context *ctx, GpgME::Error &err) } else if ((err = ctx->getAuditLog(data, CMSAuditLogFlags))) { return QString::fromLocal8Bit(err.asString()); } - const QByteArray ba = dp.data(); - return QString::fromUtf8(ba.data(), ba.size()); + return QString::fromUtf8(dp.data()); } return QStringLiteral("Unsupported protocol for Audit Log");