From 0d4be1abb93d37b10e0c7835bd79b62639945651 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 8 Nov 2026 20:07:45 +0100 Subject: Fix minor format string issues --- src/ot_stats.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ot_stats.c b/src/ot_stats.c index 0e2fc67..15c06b2 100644 --- a/src/ot_stats.c +++ b/src/ot_stats.c @@ -498,7 +498,7 @@ extern unsigned long long numwants[201]; static void stats_return_numwants(char **reply, const char *reply_end) { int i; for (i = 0; i <= 200; ++i) - fmt_append(reply, reply_end, "%03d => %lld\n", i, numwants[i]); + fmt_append(reply, reply_end, "%03d => %llu\n", i, numwants[i]); } #endif @@ -764,7 +764,8 @@ void stats_issue_event(struct ot_workstruct *ws, ot_status_event event, PROTO_FL time(&ttt); localtime_r(&ttt, &time_now); - strftime(timestring, sizeof(timestring), "%FT%T%z", &time_now); + if (!strftime(timestring, sizeof(timestring), "%FT%T%z", &time_now)) + timestring[0] = 0; hex_from_hash(hash_hex, *ws->hash); if (ws->peer_id) @@ -808,7 +809,8 @@ void stats_issue_event(struct ot_workstruct *ws, ot_status_event event, PROTO_FL COUNT(OT_COUNTER_FULLSCRAPE_REQUESTS, 1); } break; case EVENT_FAILED: - COUNT(OT_COUNTER_FAILED + event_data, 1); + if (event_data < CODE_HTTPERROR_COUNT) + COUNT(OT_COUNTER_FAILED + event_data, 1); break; case EVENT_RENEW: if (event_data < OT_PEER_TIMEOUT) -- cgit v1.3