From 578852f4cab3a24677a05c3a9e0349d0e9ba2402 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 16 May 2025 15:50:58 +0200 Subject: [PATCH] Correct two misleading comments Of course ucs4 >> 32 would be zero, as it's only a 32-bit value to begin with; and the pattern of later bytes actually processed makes quite clear what offsets the two short-cut ones really come from. Brought to light while reviewing assessment of security level. Task-number: QTBUG-135187 Change-Id: I8af6b5c935de400f3ac1c2efae297b0333891d64 Reviewed-by: Thiago Macieira --- src/corelib/io/qdebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 4600b8ee99e..e1f5035d9c0 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -276,8 +276,8 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, si buflen = 2; } else { buf[1] = 'U'; - buf[2] = '0'; // toHexUpper(ucs4 >> 32); - buf[3] = '0'; // toHexUpper(ucs4 >> 28); + buf[2] = '0'; // toHexUpper(ucs4 >> 28); + buf[3] = '0'; // toHexUpper(ucs4 >> 24); buf[4] = toHexUpper(ucs4 >> 20); buf[5] = toHexUpper(ucs4 >> 16); buf[6] = toHexUpper(ucs4 >> 12);