ACCOUNT: use more precise types and fix minor tidbits

This commit is contained in:
Jan Engelhardt
2009-10-30 18:48:04 +01:00
parent 0aa7be2f1d
commit df7168bb4d
3 changed files with 35 additions and 34 deletions

View File

@@ -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;
}