From e4eb716d2688f5c2d4615d79ad5f4f1eb50a9343 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 3 Apr 2026 01:40:39 +0200 Subject: turn all int offsets into size_t --- opentracker.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index 14e9989..f63db72 100644 --- a/opentracker.c +++ b/opentracker.c @@ -281,7 +281,8 @@ static void *server_mainloop(void *args) { struct ot_workstruct ws; time_t next_timeout_check = g_now_seconds + OT_CLIENT_TIMEOUT_CHECKINTERVAL; struct iovec *iovector; - int iovec_entries, is_partial; + size_t iovec_entries; + int is_partial; (void)args; @@ -444,7 +445,7 @@ int parse_configfile(char *config_filename) { #if defined(WANT_RESTRICT_STATS) || defined(WANT_IP_FROM_PROXY) || defined(WANT_SYNC_LIVE) ot_net tmpnet; #endif - int bound = 0; + int bound = 0; accesslist_filehandle = fopen(config_filename, "r"); @@ -566,15 +567,15 @@ void load_state(const char *const state_filename) { /* We do ignore anything that is not of the form "^[:xdigit:]:\d+:\d+" */ while (fgets(inbuf, sizeof(inbuf), state_filehandle)) { - int i; - for (i = 0; i < (int)sizeof(ot_hash); ++i) { + size_t i; + for (i = 0; i < sizeof(ot_hash); ++i) { int eger = 16 * scan_fromhex(inbuf[2 * i]) + scan_fromhex(inbuf[1 + 2 * i]); if (eger < 0) continue; infohash[i] = eger; } - if (i != (int)sizeof(ot_hash)) + if (i != sizeof(ot_hash)) continue; i *= 2; -- cgit v1.2.3