summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c11
1 files changed, 6 insertions, 5 deletions
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) {
281 struct ot_workstruct ws; 281 struct ot_workstruct ws;
282 time_t next_timeout_check = g_now_seconds + OT_CLIENT_TIMEOUT_CHECKINTERVAL; 282 time_t next_timeout_check = g_now_seconds + OT_CLIENT_TIMEOUT_CHECKINTERVAL;
283 struct iovec *iovector; 283 struct iovec *iovector;
284 int iovec_entries, is_partial; 284 size_t iovec_entries;
285 int is_partial;
285 286
286 (void)args; 287 (void)args;
287 288
@@ -444,7 +445,7 @@ int parse_configfile(char *config_filename) {
444#if defined(WANT_RESTRICT_STATS) || defined(WANT_IP_FROM_PROXY) || defined(WANT_SYNC_LIVE) 445#if defined(WANT_RESTRICT_STATS) || defined(WANT_IP_FROM_PROXY) || defined(WANT_SYNC_LIVE)
445 ot_net tmpnet; 446 ot_net tmpnet;
446#endif 447#endif
447 int bound = 0; 448 int bound = 0;
448 449
449 accesslist_filehandle = fopen(config_filename, "r"); 450 accesslist_filehandle = fopen(config_filename, "r");
450 451
@@ -566,15 +567,15 @@ void load_state(const char *const state_filename) {
566 567
567 /* We do ignore anything that is not of the form "^[:xdigit:]:\d+:\d+" */ 568 /* We do ignore anything that is not of the form "^[:xdigit:]:\d+:\d+" */
568 while (fgets(inbuf, sizeof(inbuf), state_filehandle)) { 569 while (fgets(inbuf, sizeof(inbuf), state_filehandle)) {
569 int i; 570 size_t i;
570 for (i = 0; i < (int)sizeof(ot_hash); ++i) { 571 for (i = 0; i < sizeof(ot_hash); ++i) {
571 int eger = 16 * scan_fromhex(inbuf[2 * i]) + scan_fromhex(inbuf[1 + 2 * i]); 572 int eger = 16 * scan_fromhex(inbuf[2 * i]) + scan_fromhex(inbuf[1 + 2 * i]);
572 if (eger < 0) 573 if (eger < 0)
573 continue; 574 continue;
574 infohash[i] = eger; 575 infohash[i] = eger;
575 } 576 }
576 577
577 if (i != (int)sizeof(ot_hash)) 578 if (i != sizeof(ot_hash))
578 continue; 579 continue;
579 i *= 2; 580 i *= 2;
580 581