From dc72190d88749b7a614eb20b58783e4c6d175b32 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 29 Jul 2025 21:03:52 -0400 Subject: [PATCH] otp: Correct some 64-bit time_t warnings Change-Id: Ic2c00168170cee797a8ac7de1df2cb6650a9184d --- apps/plugins/otp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/plugins/otp.c b/apps/plugins/otp.c index 0983e78cd0..d208353145 100644 --- a/apps/plugins/otp.c +++ b/apps/plugins/otp.c @@ -44,7 +44,7 @@ struct account_t { union { uint64_t hotp_counter; - int totp_period; + unsigned long totp_period; }; int digits; @@ -528,12 +528,12 @@ static void show_code(int acct) #if CONFIG_RTC else { - rb->splashf(0, "%0*d (%ld seconds(s) left)", accounts[acct].digits, + rb->splashf(0, "%0*d (%lu seconds(s) left)", accounts[acct].digits, TOTP(accounts[acct].secret, accounts[acct].sec_len, accounts[acct].totp_period, accounts[acct].digits), - accounts[acct].totp_period - get_utc() % accounts[acct].totp_period); + accounts[acct].totp_period - (unsigned long) get_utc() % accounts[acct].totp_period); } #else else @@ -693,7 +693,7 @@ static void edit_menu(int acct) if(accounts[acct].is_totp) rb->snprintf(data_buf, sizeof(data_buf), "%d", (int)accounts[acct].hotp_counter); else - rb->snprintf(data_buf, sizeof(data_buf), "%d", accounts[acct].totp_period); + rb->snprintf(data_buf, sizeof(data_buf), "%lu", accounts[acct].totp_period); if(rb->kbd_input(data_buf, sizeof(data_buf), NULL) < 0) break;