diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-04-03 01:40:39 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-04-03 01:40:39 +0200 |
| commit | e4eb716d2688f5c2d4615d79ad5f4f1eb50a9343 (patch) | |
| tree | 5612056173478fecaad0a030195b6ed2f399df4d /ot_accesslist.c | |
| parent | b20b0b89264e9d28ab873b8b1cc9ba73cdb58aeb (diff) | |
turn all int offsets into size_t
Diffstat (limited to 'ot_accesslist.c')
| -rw-r--r-- | ot_accesslist.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ot_accesslist.c b/ot_accesslist.c index 4b88c40..253fe95 100644 --- a/ot_accesslist.c +++ b/ot_accesslist.c | |||
| @@ -129,8 +129,8 @@ static void accesslist_readfile(void) { | |||
| 129 | 129 | ||
| 130 | /* We do ignore anything that is not of the form "^[:xdigit:]{40}[^:xdigit:].*" */ | 130 | /* We do ignore anything that is not of the form "^[:xdigit:]{40}[^:xdigit:].*" */ |
| 131 | while (read_offs <= map_end) { | 131 | while (read_offs <= map_end) { |
| 132 | int i; | 132 | size_t i; |
| 133 | for (i = 0; i < (int)sizeof(ot_hash); ++i) { | 133 | for (i = 0; i < sizeof(ot_hash); ++i) { |
| 134 | int eger1 = scan_fromhex((unsigned char)read_offs[2 * i]); | 134 | int eger1 = scan_fromhex((unsigned char)read_offs[2 * i]); |
| 135 | int eger2 = scan_fromhex((unsigned char)read_offs[1 + 2 * i]); | 135 | int eger2 = scan_fromhex((unsigned char)read_offs[1 + 2 * i]); |
| 136 | if (eger1 < 0 || eger2 < 0) | 136 | if (eger1 < 0 || eger2 < 0) |
| @@ -262,7 +262,7 @@ static void *accesslist_adddel_worker(char *fifoname, ot_accesslist *_Atomic | |||
| 262 | 262 | ||
| 263 | while ((linelen = getline(&line, &linecap, fifo)) > 0) { | 263 | while ((linelen = getline(&line, &linecap, fifo)) > 0) { |
| 264 | ot_hash info_hash; | 264 | ot_hash info_hash; |
| 265 | int i; | 265 | size_t i; |
| 266 | 266 | ||
| 267 | printf("Got line %*s", (int)linelen, line); | 267 | printf("Got line %*s", (int)linelen, line); |
| 268 | /* We do ignore anything that is not of the form "^[:xdigit:]{40}[^:xdigit:].*" | 268 | /* We do ignore anything that is not of the form "^[:xdigit:]{40}[^:xdigit:].*" |
| @@ -270,7 +270,7 @@ static void *accesslist_adddel_worker(char *fifoname, ot_accesslist *_Atomic | |||
| 270 | if (linelen < 41) | 270 | if (linelen < 41) |
| 271 | continue; | 271 | continue; |
| 272 | 272 | ||
| 273 | for (i = 0; i < (int)sizeof(ot_hash); ++i) { | 273 | for (i = 0; i < sizeof(ot_hash); ++i) { |
| 274 | int eger1 = scan_fromhex((unsigned char)line[2 * i]); | 274 | int eger1 = scan_fromhex((unsigned char)line[2 * i]); |
| 275 | int eger2 = scan_fromhex((unsigned char)line[1 + 2 * i]); | 275 | int eger2 = scan_fromhex((unsigned char)line[1 + 2 * i]); |
| 276 | if (eger1 < 0 || eger2 < 0) | 276 | if (eger1 < 0 || eger2 < 0) |
| @@ -511,7 +511,7 @@ int proxylist_check_proxy(const ot_ip6 proxy, const ot_ip6 address) { | |||
| 511 | 511 | ||
| 512 | static ot_net g_admin_nets[OT_ADMINIP_MAX]; | 512 | static ot_net g_admin_nets[OT_ADMINIP_MAX]; |
| 513 | static ot_permissions g_admin_nets_permissions[OT_ADMINIP_MAX]; | 513 | static ot_permissions g_admin_nets_permissions[OT_ADMINIP_MAX]; |
| 514 | static unsigned int g_admin_nets_count = 0; | 514 | static size_t g_admin_nets_count = 0; |
| 515 | 515 | ||
| 516 | int accesslist_bless_net(ot_net *net, ot_permissions permissions) { | 516 | int accesslist_bless_net(ot_net *net, ot_permissions permissions) { |
| 517 | if (g_admin_nets_count >= OT_ADMINIP_MAX) | 517 | if (g_admin_nets_count >= OT_ADMINIP_MAX) |
| @@ -553,7 +553,7 @@ int accesslist_bless_net(ot_net *net, ot_permissions permissions) { | |||
| 553 | } | 553 | } |
| 554 | 554 | ||
| 555 | int accesslist_is_blessed(ot_ip6 ip, ot_permissions permissions) { | 555 | int accesslist_is_blessed(ot_ip6 ip, ot_permissions permissions) { |
| 556 | unsigned int i; | 556 | size_t i; |
| 557 | for (i = 0; i < g_admin_nets_count; ++i) | 557 | for (i = 0; i < g_admin_nets_count; ++i) |
| 558 | if (address_in_net(ip, g_admin_nets + i) && (g_admin_nets_permissions[i] & permissions)) | 558 | if (address_in_net(ip, g_admin_nets + i) && (g_admin_nets_permissions[i] & permissions)) |
| 559 | return 1; | 559 | return 1; |
