Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
windows:mingw
kcoreaddons
0001-KRandom-randomString-properly-cast-from-ch...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-KRandom-randomString-properly-cast-from-char-to-QCha.patch of Package kcoreaddons
From 79f5111129f27e73555f2ea061f2c6011423245c Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" <kossebau@kde.org> Date: Wed, 11 Nov 2020 23:01:14 +0100 Subject: [PATCH 1/1] KRandom::randomString: properly cast from char to QChar QT_NO_CAST_FROM_ASCII can break code without the compiler warning about when one assigns chars > 127 to a QCharRef. Because instead of the no longer available char argument overload the int overload is used: QCharRef &QCharRefoperator=(int rc) which then gets bad negative values passed after the implicit cast. Never happens here but better safe then sorry, also preparing for the case future Qt properly catches a left-over assignment from a char type to a QCharRef. NO_CHANGELOG --- src/lib/randomness/krandom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/randomness/krandom.cpp b/src/lib/randomness/krandom.cpp index 90e0dbb2..16ba7d5a 100644 --- a/src/lib/randomness/krandom.cpp +++ b/src/lib/randomness/krandom.cpp @@ -72,7 +72,7 @@ QString KRandom::randomString(int length) if (r > 90) { r += 6; } - str[i++] = char(r); + str[i++] = QLatin1Char(char(r)); // so what if I work backwards? } return str; -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor