summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-08 20:07:45 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-08 20:07:45 +0100
commit0d4be1abb93d37b10e0c7835bd79b62639945651 (patch)
tree132ff7ef9b141e19b34f7771a008a8141f5177b1 /src
parent6bec0aef4f42885bcdef31c633ebc9e5264a4615 (diff)
Fix minor format string issues
Diffstat (limited to 'src')
-rw-r--r--src/ot_stats.c8
1 files changed, 5 insertions, 3 deletions
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];
498static void stats_return_numwants(char **reply, const char *reply_end) { 498static void stats_return_numwants(char **reply, const char *reply_end) {
499 int i; 499 int i;
500 for (i = 0; i <= 200; ++i) 500 for (i = 0; i <= 200; ++i)
501 fmt_append(reply, reply_end, "%03d => %lld\n", i, numwants[i]); 501 fmt_append(reply, reply_end, "%03d => %llu\n", i, numwants[i]);
502} 502}
503#endif 503#endif
504 504
@@ -764,7 +764,8 @@ void stats_issue_event(struct ot_workstruct *ws, ot_status_event event, PROTO_FL
764 764
765 time(&ttt); 765 time(&ttt);
766 localtime_r(&ttt, &time_now); 766 localtime_r(&ttt, &time_now);
767 strftime(timestring, sizeof(timestring), "%FT%T%z", &time_now); 767 if (!strftime(timestring, sizeof(timestring), "%FT%T%z", &time_now))
768 timestring[0] = 0;
768 769
769 hex_from_hash(hash_hex, *ws->hash); 770 hex_from_hash(hash_hex, *ws->hash);
770 if (ws->peer_id) 771 if (ws->peer_id)
@@ -808,7 +809,8 @@ void stats_issue_event(struct ot_workstruct *ws, ot_status_event event, PROTO_FL
808 COUNT(OT_COUNTER_FULLSCRAPE_REQUESTS, 1); 809 COUNT(OT_COUNTER_FULLSCRAPE_REQUESTS, 1);
809 } break; 810 } break;
810 case EVENT_FAILED: 811 case EVENT_FAILED:
811 COUNT(OT_COUNTER_FAILED + event_data, 1); 812 if (event_data < CODE_HTTPERROR_COUNT)
813 COUNT(OT_COUNTER_FAILED + event_data, 1);
812 break; 814 break;
813 case EVENT_RENEW: 815 case EVENT_RENEW:
814 if (event_data < OT_PEER_TIMEOUT) 816 if (event_data < OT_PEER_TIMEOUT)