From 4acbb894b7db23d35a7c4b863d65e149243a0b7d Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 4 Mar 2023 21:10:12 +0100 Subject: Fix brainfart in durationFromSecs Use QString::arg() instead of ::snprintf because of a comiler truncation warning. --- helper.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'helper.cpp') diff --git a/helper.cpp b/helper.cpp index e1ddc10..32dc11c 100644 --- a/helper.cpp +++ b/helper.cpp @@ -188,8 +188,7 @@ namespace Helper { } seconds = secs - hours * 60 * 60 - minutes * 60; seconds = (seconds > 60) ? 59 : seconds; - QByteArray retval(10, '\0'); - ::snprintf(retval.data(), 9, "%.2lld:%.2lld:%.2lld", hours, minutes, seconds); + QString retval = QString("%1:%2:%3").arg(hours, 2, 10, QChar('0')).arg(minutes, 2, 10, QChar('0')).arg(seconds, 2, 10, QChar('0')); return retval; } -- cgit v1.2.3-70-g09d2