style: format code (80 col)

This commit is contained in:
lohhiiccc 2026-03-23 09:21:37 -05:00
parent 3c493c685e
commit 297d38bff1
4 changed files with 9 additions and 5 deletions

View file

@ -9,7 +9,8 @@ print_version(void)
printf("Copyright (C) 2026 lohhiicccc\n"); printf("Copyright (C) 2026 lohhiicccc\n");
printf("License GPLv3+:"); printf("License GPLv3+:");
printf("GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>\n"); printf("GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>\n");
printf("This is free software: you are free to change and redistribute it.\n"); printf("This is free software: ");
printf("you are free to change and redistribute it.\n");
printf("There is NO WARRANTY, to the extent permitted by law.\n"); printf("There is NO WARRANTY, to the extent permitted by law.\n");
printf("\n"); printf("\n");
#if PING_HAS_GIT_COMMIT #if PING_HAS_GIT_COMMIT

View file

@ -19,7 +19,8 @@ cli_parse_destinations(int argc, char **argv, int first_arg,
for (int i = first_arg; i < argc; i++) for (int i = first_arg; i < argc; i++)
{ {
if (0 != cli_parse_inet_addr(argv[i], &config->destinations[i - first_arg])) if (0 != cli_parse_inet_addr(argv[i],
&config->destinations[i - first_arg]))
{ {
free(config->destinations); free(config->destinations);
config->destinations = NULL; config->destinations = NULL;

View file

@ -36,8 +36,10 @@ print_loss_line(size_t sent, size_t ok_recv, size_t errors)
printf("%zu packets transmitted, %zu packets received, +%zu errors," printf("%zu packets transmitted, %zu packets received, +%zu errors,"
" %d%% packet loss\n", sent, ok_recv, errors, loss_pct); " %d%% packet loss\n", sent, ok_recv, errors, loss_pct);
else else
printf("%zu packets transmitted, %zu packets received, %d%% packet loss\n", {
sent, ok_recv, loss_pct); printf("%zu packets transmitted, %zu packets received,", sent, ok_recv);
printf(" %d%% packet loss\n", loss_pct);
}
} }
static void static void

View file

@ -15,7 +15,7 @@ Test(cli_parse_inet_addr, valid_ip)
Test(cli_parse_inet_addr, invalid_host) Test(cli_parse_inet_addr, invalid_host)
{ {
struct destinations out = {0}; struct destinations out = {0};
int ret = cli_parse_inet_addr("not.a.real.host.invalid", &out); int ret = cli_parse_inet_addr("invalid.host.local", &out);
cr_assert_eq(ret, 1); cr_assert_eq(ret, 1);
} }