1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 18:27:04 +03:00

network: fix scanf/printf format

usec_t is defined as 64 bit wide, but long is 32 bit on many archs.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2015-01-01 11:15:50 -05:00
parent e65ef51dee
commit ef75325319
2 changed files with 3 additions and 3 deletions

View File

@ -495,7 +495,7 @@ int sd_lldp_save(sd_lldp *lldp, const char *lldp_file) {
if (time - p->until <= 0)
continue;
sprintf(buf, "'_TTL=%lu' ", p->until);
sprintf(buf, "'_TTL="USEC_FMT"' ", p->until);
k = strappend(s, buf);
if (!k)

View File

@ -972,7 +972,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
time = now(CLOCK_BOOTTIME);
sscanf(b, "%lu", &until);
sscanf(b, USEC_FMT, &until);
ttl = (until - time) / USEC_PER_SEC;
@ -986,7 +986,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
}
if (until > time) {
printf("%10s %24s %16s %16lu %16s\n", links[i].name, chassis, port, ttl, cap);
printf("%10s %24s %16s %16"PRIu64" %16s\n", links[i].name, chassis, port, ttl, cap);
j++;
}
}