summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c0ad7de)
raw | patch | inline | side by side (parent: c0ad7de)
author | fgsfds <derp.primus@gmail.com> | |
Sat, 15 Jul 2023 21:24:02 +0000 (23:24 +0200) | ||
committer | fgsfds <derp.primus@gmail.com> | |
Sat, 15 Jul 2023 21:24:02 +0000 (23:24 +0200) |
src/mastersrv/master.c | patch | blob | history |
diff --git a/src/mastersrv/master.c b/src/mastersrv/master.c
index 6bb4ffd22ef92de2ae8e551a4a32c1d0d948f2b1..b05f11326cb1a99c5c8695e41b182339951b1270 100644 (file)
--- a/src/mastersrv/master.c
+++ b/src/mastersrv/master.c
continue;
char ip[21] = { 0 }; // optionally includes the "/nn" prefix length at the end
- int64_t exp64 = 0;
+ int expd = 0;
int count = 0;
- if (sscanf(ln, "%20s %lld %d", ip, &exp64, &count) < 3) {
+ if (sscanf(ln, "%20s %d %d", ip, &expd, &count) < 3) {
u_log(LOG_ERROR, "banlist: malformed line: `%s`", ln);
continue;
}
- const time_t exp = (time_t)exp64; // shut up gcc
+ const time_t exp = (time_t)expd; // shut up gcc
if (ban_record_add_ip(ip, count, exp))
u_log(LOG_NOTE, "banlist: banned %s until %s (ban level %d)", ip, u_strtime(exp), count);
}
for (ban_record_t *rec = banlist; rec; rec = rec->next) {
if (rec->ban_count)
- fprintf(f, "%s/%u %lld %d\n", u_iptostr(rec->host), u_masktoprefix(rec->mask), (int64_t)rec->cur_ban, rec->ban_count);
+ fprintf(f, "%s/%u %d %d\n", u_iptostr(rec->host), u_masktoprefix(rec->mask), (int)rec->cur_ban, rec->ban_count);
}
fclose(f);