mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 05:05:12 +02:00
ACCOUNT: use more precise types and fix minor tidbits
This commit is contained in:
@@ -34,16 +34,14 @@ static void sig_term(int signr)
|
||||
exit_now = true;
|
||||
}
|
||||
|
||||
char *addr_to_dotted(unsigned int);
|
||||
char *addr_to_dotted(unsigned int addr)
|
||||
static char *addr_to_dotted(unsigned int addr)
|
||||
{
|
||||
static char buf[17];
|
||||
static char buf[16];
|
||||
const unsigned char *bytep;
|
||||
|
||||
addr = ntohl(addr);
|
||||
bytep = (const unsigned char *)&addr;
|
||||
snprintf(buf, 16, "%u.%u.%u.%u", bytep[3], bytep[2], bytep[1], bytep[0]);
|
||||
buf[16] = 0;
|
||||
snprintf(buf, sizeof(buf), "%u.%u.%u.%u", bytep[3], bytep[2], bytep[1], bytep[0]);
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -190,7 +188,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
printf("Read failed: %s\n", ctx.error_str);
|
||||
ipt_ACCOUNT_deinit(&ctx);
|
||||
exit(-1);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!doCSV)
|
||||
@@ -221,5 +219,5 @@ int main(int argc, char *argv[])
|
||||
|
||||
printf("Finished.\n");
|
||||
ipt_ACCOUNT_deinit(&ctx);
|
||||
exit(0);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user