qvsnprintf: port from qt_saturate to q26::saturate_cast

The latter isn't in Qt 6.5 to which the amended commit was picked, so
we used the old name qt_saturate there. This patch ports to the new
name.

Amends the commit that fixed QTBUG-138860 (final SHA-1 not known at
this point).

Task-number: QTBUG-138860
Pick-to: 6.10 6.9 6.8
Change-Id: Ia84ae50ddfd18cf028ecc7461821f4e727f0009a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2025-08-01 12:52:15 +02:00
parent 46b8f2eb1a
commit f49ba1a6ec
1 changed files with 2 additions and 2 deletions

View File

@ -5,10 +5,10 @@
#include "qplatformdefs.h"
#include "qbytearray.h"
#include <QtCore/private/qnumeric_p.h>
#include "qstring.h"
#include <cerrno>
#include <QtCore/q26numeric.h>
#include "string.h"
@ -68,7 +68,7 @@ int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap)
const auto realSize = ba.size();
int result;
if constexpr (sizeof(int) != sizeof(realSize)) {
result = qt_saturate<int>(realSize);
result = q26::saturate_cast<int>(realSize);
if (result != realSize) {
errno = EOVERFLOW;
return -1;