aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-08-17 12:51:19 +0000
committerIngo Klöcker <[email protected]>2022-08-17 12:52:04 +0000
commitc977424a1d39751fc5055131ad3f7819d421dcc8 (patch)
tree169431ada3040cab7bb385827b49fb0475e46633
parentw32: Add another fallback to look for gpgconf.exe (diff)
downloadgpgme-c977424a1d39751fc5055131ad3f7819d421dcc8.tar.gz
gpgme-c977424a1d39751fc5055131ad3f7819d421dcc8.zip
qt: Make sure expiration time is interpreted as unsigned number
* lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp (add_subkey): Convert expiration time to uint_least32_t. -- This fixes the corresponding test on 32-bit systems where time_t (the return type of expirationTime()) is a signed 32-bit integer type. GnuPG-bug-id: 6137
-rw-r--r--lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp b/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp
index 32e2c292..b74e7a06 100644
--- a/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp
+++ b/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp
@@ -64,7 +64,8 @@ static QGpgMEAddExistingSubkeyJob::result_type add_subkey(Context *ctx, const Ke
std::unique_ptr<GpgAddExistingSubkeyEditInteractor> interactor{new GpgAddExistingSubkeyEditInteractor{subkey.keyGrip()}};
if (!subkey.neverExpires()) {
- const auto expiry = QDateTime::fromSecsSinceEpoch(subkey.expirationTime(), Qt::UTC).toString(u"yyyyMMdd'T'hhmmss").toStdString();
+ const auto expiry = QDateTime::fromSecsSinceEpoch(uint_least32_t(subkey.expirationTime()),
+ Qt::UTC).toString(u"yyyyMMdd'T'hhmmss").toStdString();
interactor->setExpiry(expiry);
}