From fd38e84da66e9f57bdac27f24db2f238d5d6cbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sat, 6 Jan 2024 09:22:11 +0100 Subject: [PATCH] Fix for Android for adept_loan_mgt.cpp (strptime format) --- utils/adept_loan_mgt.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/adept_loan_mgt.cpp b/utils/adept_loan_mgt.cpp index 2bc944e..22ed6db 100644 --- a/utils/adept_loan_mgt.cpp +++ b/utils/adept_loan_mgt.cpp @@ -183,8 +183,13 @@ private: loan->bookName = node.first_child().value(); struct tm tm; +#ifdef __ANDROID__ + res = strptime(loan->validity.c_str(), "%Y-%m-%dT%H:%M:%S%z", &tm); +#else res = strptime(loan->validity.c_str(), "%Y-%m-%dT%H:%M:%S%Z", &tm); - if (*res == 0) +#endif + + if (res != NULL && *res == 0) { if (mktime(&tm) <= time(NULL)) loan->validity = " (Expired)";