diff options
| author | David M. Syzdek <david@syzdek.net> | 2013-12-05 15:07:24 -0900 |
|---|---|---|
| committer | David M. Syzdek <syzdek@bindlebinaries.com> | 2013-12-05 15:16:21 -0900 |
| commit | 765c90c62f3548884e2618626071ca86c2111368 (patch) | |
| tree | b58484dae32c3c22015d9208ca3d2e2e3c07155d /src/netcalc.c | |
| parent | e6468019957fec1c7fe4f4f11ace77c8b693a9ac (diff) | |
| download | dmstools-765c90c62f3548884e2618626071ca86c2111368.tar.gz dmstools-765c90c62f3548884e2618626071ca86c2111368.tar.bz2 dmstools-765c90c62f3548884e2618626071ca86c2111368.tar.xz dmstools-765c90c62f3548884e2618626071ca86c2111368.zip | |
Fixing printf format string.
Signed-off-by: David M. Syzdek <syzdek@bindlebinaries.com>
Diffstat (limited to 'src/netcalc.c')
| -rw-r--r-- | src/netcalc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/netcalc.c b/src/netcalc.c index 21d31d2..43599ff 100644 --- a/src/netcalc.c +++ b/src/netcalc.c | |||
| @@ -157,7 +157,7 @@ const char * netcalc_ipv4tostr(uint64_t ipv4) | |||
| 157 | int offset; | 157 | int offset; |
| 158 | offset = 0; | 158 | offset = 0; |
| 159 | for(c = 0; c < 4; c++) | 159 | for(c = 0; c < 4; c++) |
| 160 | offset += snprintf(&buff[offset], 1024-offset, "%lli.", ((ipv4 >> (24 - (8*c)))&0xff) ); | 160 | offset += snprintf(&buff[offset], 1024-offset, "%" PRIu64 ".", ((ipv4 >> (24 - (8*c)))&0xff) ); |
| 161 | buff[offset-1] = '\0'; | 161 | buff[offset-1] = '\0'; |
| 162 | return(buff); | 162 | return(buff); |
| 163 | } | 163 | } |
| @@ -380,10 +380,10 @@ int main(int argc, char * argv[]) | |||
| 380 | 380 | ||
| 381 | // prints information | 381 | // prints information |
| 382 | printf("%-18s", netcalc_ipv4tostr(network)); | 382 | printf("%-18s", netcalc_ipv4tostr(network)); |
| 383 | printf("%-8lli", cidr); | 383 | printf("%-8" PRIu64, cidr); |
| 384 | printf("%-18s", netcalc_ipv4tostr(netmask)); | 384 | printf("%-18s", netcalc_ipv4tostr(netmask)); |
| 385 | printf("%-18s", netcalc_ipv4tostr(broadcast)); | 385 | printf("%-18s", netcalc_ipv4tostr(broadcast)); |
| 386 | printf("%llu", (~netmask + 1)); | 386 | printf("%" PRIu64, (~netmask + 1)); |
| 387 | printf("\n"); | 387 | printf("\n"); |
| 388 | 388 | ||
| 389 | // moves to next netmask/cidr | 389 | // moves to next netmask/cidr |
