@@ -424,15 +424,15 @@ void printUnicastProperties(std::ostream& os,
424424 ntohs (ipv6address.s6_addr16 [0 ]) & 0xff ,
425425 ntohs (ipv6address.s6_addr16 [1 ]),
426426 ntohs (ipv6address.s6_addr16 [2 ]));
427- os << " + " << format (" %-32s = %s " , gettext (" Global ID" ), globalIDString) << " \n " ;
427+ os << " + " << format (gettext ( " %-32s" ) , gettext (" Global ID" )) << " = " << globalIDString << " \n " ;
428428 }
429429
430430 // ====== Subnet ID ======================================================
431431 if (hasSubnetID) {
432432 char subnetIDString[16 ];
433433 const uint16_t subnetID = ntohs (ipv6address.s6_addr16 [3 ]);
434434 snprintf ((char *)&subnetIDString, sizeof (subnetIDString), " %04x" , subnetID);
435- os << " + " << format (" %-32s = %s " , gettext (" Subnet ID" ), subnetIDString) << " \n " ;
435+ os << " + " << format (gettext ( " %-32s" ) , gettext (" Subnet ID" )) << " = " << subnetIDString << " \n " ;
436436 }
437437
438438 // ====== Interface ID ===================================================
@@ -448,7 +448,7 @@ void printUnicastProperties(std::ostream& os,
448448 (interfaceID[1 ] & 0xff00 ) >> 8 , (interfaceID[1 ] & 0x00ff ),
449449 (interfaceID[2 ] & 0xff00 ) >> 8 , (interfaceID[2 ] & 0x00ff ),
450450 interfaceID[3 ]);
451- os << " + " << format (" %-32s = %s " , gettext (" Interface ID" ), interfaceIDString) << " \n " ;
451+ os << " + " << format (gettext ( " %-32s" ) , gettext (" Interface ID" )) << " = " << interfaceIDString << " \n " ;
452452
453453 if ( ((interfaceID[1 ] & 0x00ff ) == 0x00ff ) &&
454454 ((interfaceID[2 ] & 0xff00 ) == 0xfe00 ) ) {
@@ -461,7 +461,7 @@ void printUnicastProperties(std::ostream& os,
461461 ipv6address.s6_addr [13 ],
462462 ipv6address.s6_addr [14 ],
463463 ipv6address.s6_addr [15 ]);
464- os << " + " << format (" %-32s = %s " , gettext (" MAC Address" ), interfaceIDString) << " \n " ;
464+ os << " + " << format (gettext ( " %-32s" ) , gettext (" MAC Address" )) << " = " << interfaceIDString << " \n " ;
465465 }
466466
467467 // ====== Solicited Node Multicast Address ===============================
@@ -471,7 +471,7 @@ void printUnicastProperties(std::ostream& os,
471471 " ff02::1:ff%02x:%04x" ),
472472 ntohs (ipv6address.s6_addr16 [6 ]) & 0xff ,
473473 ntohs (ipv6address.s6_addr16 [7 ]));
474- os << " + " << format (" %-32s = %s " , gettext (" Solicited Node Multicast Address" ), snmcAddressString) << " \n " ;
474+ os << " + " << format (gettext ( " %-32s" ) , gettext (" Solicited Node Multicast Address" )) << " = " << snmcAddressString << " \n " ;
475475}
476476
477477
@@ -488,7 +488,7 @@ void printAddressProperties(std::ostream& os,
488488 address2string (&address.sa , addressString, sizeof (addressString), false , false );
489489
490490 // ====== Common properties ==============================================
491- os << format (" %-16s " , gettext (" Properties" )) << " = \n " ;
491+ os << format (gettext ( " %-14s " ) , gettext (" Properties" )) << " = \n " ;
492492 os << " - " ;
493493 if (isMulticast (address)) {
494494 os << format (gettext (" %s is a MULTICAST address" ), addressString);
@@ -873,15 +873,16 @@ int main(int argc, char** argv)
873873
874874
875875 // ====== Print results ==================================================
876- std::cout << format (" %-16s " , gettext (" Address" )) << " = "
876+ std::cout << format (gettext ( " %-14s " ) , gettext (" Address" )) << " = "
877877 << address << " \n " ;
878- printAddressBinary (std::cout, address, prefix, colourMode, " " );
879- std::cout << format (" %-16s" , gettext (" Network" )) << " = "
878+ printAddressBinary (std::cout, address, prefix, colourMode,
879+ (format (gettext (" %-14s" ), " " ) + " " ).c_str ());
880+ std::cout << format (gettext (" %-14s" ), gettext (" Network" )) << " = "
880881 << network << " / " << prefix << " \n "
881- << format (" %-16s " , gettext (" Netmask" )) << " = "
882+ << format (gettext ( " %-14s " ) , gettext (" Netmask" )) << " = "
882883 << netmask << " \n " ;
883884 if (isIPv4 (address)) {
884- std::cout << format (" %-16s " , gettext (" Broadcast" )) << " = " ;
885+ std::cout << format (gettext ( " %-14s " ) , gettext (" Broadcast" )) << " = " ;
885886 if (reservedHosts == 2 ) {
886887 std::cout << broadcast;
887888 }
@@ -890,15 +891,15 @@ int main(int argc, char** argv)
890891 }
891892 std::cout << " \n " ;
892893 }
893- std::cout << format (" %-16s " , gettext (" Wildcard Mask" ))
894+ std::cout << format (gettext ( " %-14s " ) , gettext (" Wildcard Mask" ))
894895 << " = " << wildcard << " \n " ;
895896 if (isIPv4 (address)) {
896897 char hex[16 ];
897898 snprintf ((char *)&hex, sizeof (hex), " %08X" , ntohl (address.in .sin_addr .s_addr ));
898- std::cout << format (" %-16s " , gettext (" Hex. Address" ))
899+ std::cout << format (gettext ( " %-14s " ) , gettext (" Hex. Address" ))
899900 << " = " << hex << " \n " ;
900901 }
901- std::cout << format (" %-16s " , gettext (" Hosts Bits" )) << " = "
902+ std::cout << format (gettext ( " %-14s " ) , gettext (" Hosts Bits" )) << " = "
902903 << hostBits << " \n " ;
903904 if (!isMulticast (address)) {
904905 char maxHostsString[128 ];
@@ -910,9 +911,9 @@ int main(int argc, char** argv)
910911 snprintf ((char *)&maxHostsString, sizeof (maxHostsString),
911912 " 2^%u - %u" , hostBits, reservedHosts);
912913 }
913- std::cout << format (" %-16s " , gettext (" Max. Hosts" )) << " = "
914+ std::cout << format (gettext ( " %-14s " ) , gettext (" Max. Hosts" )) << " = "
914915 << maxHostsString << " \n "
915- << format (" %-16s " , gettext (" Host Range" )) << " = { "
916+ << format (gettext ( " %-14s " ) , gettext (" Host Range" )) << " = { "
916917 << host1 << " - " << host2 << " }" << " \n " ;
917918 }
918919
@@ -936,15 +937,15 @@ int main(int argc, char** argv)
936937 GeoIP* geoIP = GeoIP_open_type (GEOIP_ASNUM_EDITION, GEOIP_STANDARD);
937938 if (geoIP) {
938939 const char * org = GeoIP_name_by_ipnum (geoIP, ntohl (address.in .sin_addr .s_addr ));
939- std::cout << format (" %-16s = " , gettext (" GeoIP AS Info" ))
940+ std::cout << format (" %-14s = " , gettext (" GeoIP AS Info" ))
940941 << ((org != nullptr ) ? org : " Unknown" ) << " \n " ;
941942 GeoIP_delete (geoIP);
942943 }
943944 geoIP = GeoIP_open_type (GEOIP_COUNTRY_EDITION, GEOIP_STANDARD);
944945 if (geoIP) {
945946 country = GeoIP_country_name_by_ipnum (geoIP, ntohl (address.in .sin_addr .s_addr ));
946947 code = GeoIP_country_code_by_ipnum (geoIP, ntohl (address.in .sin_addr .s_addr ));
947- std::cout << format (" %-16s = " , gettext (" GeoIP Country" ))
948+ std::cout << format (" %-14s = " , gettext (" GeoIP Country" ))
948949 << ((country != nullptr ) ? country: " Unknown" )
949950 << " (" << ((code != nullptr ) ? code : " ??" ) << " )" << " \n " ;
950951 GeoIP_delete (geoIP);
@@ -955,7 +956,7 @@ int main(int argc, char** argv)
955956 if (gir != nullptr ) {
956957 const char * timeZone = GeoIP_time_zone_by_country_and_region (
957958 gir->country_code , gir->region );
958- std::cout << format (" %-16s = " , gettext (" GeoIP Region" ))
959+ std::cout << format (" %-14s = " , gettext (" GeoIP Region" ))
959960 << ((gir->postal_code != nullptr ) ? gir->postal_code : " " )
960961 << ((gir->postal_code != nullptr ) ? " " : " " )
961962 << ((gir->city != nullptr ) ? gir->city : " Unknown" )
@@ -977,15 +978,15 @@ int main(int argc, char** argv)
977978 GeoIP* geoIP = GeoIP_open_type (GEOIP_ASNUM_EDITION_V6, GEOIP_STANDARD);
978979 if (geoIP) {
979980 const char * org = GeoIP_name_by_ipnum_v6 (geoIP, address.in6 .sin6_addr );
980- std::cout << format (" %-16s = " , gettext (" GeoIP AS Info" ))
981+ std::cout << format (" %-14s = " , gettext (" GeoIP AS Info" ))
981982 << ((org != nullptr ) ? org : " Unknown" ) << " \n " ;
982983 GeoIP_delete (geoIP);
983984 }
984985 geoIP = GeoIP_open_type (GEOIP_COUNTRY_EDITION_V6, GEOIP_STANDARD);
985986 if (geoIP) {
986987 country = GeoIP_country_name_by_ipnum_v6 (geoIP, address.in6 .sin6_addr );
987988 code = GeoIP_country_code_by_ipnum_v6 (geoIP, address.in6 .sin6_addr );
988- std::cout << format (" %-16s = " , gettext (" GeoIP Country" ))
989+ std::cout << format (" %-14s = " , gettext (" GeoIP Country" ))
989990 << ((country != nullptr ) ? country: " Unknown" )
990991 << " (" << ((code != nullptr ) ? code : " ??" ) << " )" << " \n " ;
991992 GeoIP_delete (geoIP);
@@ -996,7 +997,7 @@ int main(int argc, char** argv)
996997 if (gir != nullptr ) {
997998 const char * timeZone = GeoIP_time_zone_by_country_and_region (
998999 gir->country_code , gir->region );
999- std::cout << format (" %-16s = " , gettext (" GeoIP Region" ))
1000+ std::cout << format (" %-14s = " , gettext (" GeoIP Region" ))
10001001 << ((gir->postal_code != nullptr ) ? gir->postal_code : " " )
10011002 << ((gir->postal_code != nullptr ) ? " " : " " )
10021003 << ((gir->city != nullptr ) ? gir->city : " Unknown" )
@@ -1037,7 +1038,7 @@ int main(int argc, char** argv)
10371038#endif
10381039 );
10391040 std::cout << " \r\x1b [K"
1040- << format (" %-16s = " , gettext (" DNS Hostname" ));
1041+ << format (" %-14s = " , gettext (" DNS Hostname" ));
10411042 std::cout.flush ();
10421043 if (error == 0 ) {
10431044 std::cout << hostname << " \n " ;
0 commit comments