From: Guus Sliepen Date: Sat, 2 Sep 2017 19:55:47 +0000 (+0200) Subject: Drop h and hh length modifiers from printf format strings. X-Git-Tag: release-1.1pre15~1 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=4e5c2193a1fa1ed054956fc0b1df387b19c546a5 Drop h and hh length modifiers from printf format strings. --- diff --git a/src/node.c b/src/node.c index 7242e950..b17e6929 100644 --- a/src/node.c +++ b/src/node.c @@ -186,9 +186,9 @@ bool dump_nodes(connection_t *c) { for splay_each(node_t, n, node_tree) { char id[2 * sizeof n->id + 1]; for (size_t c = 0; c < sizeof n->id; ++c) - snprintf(id + 2 * c, 3, "%02hhx", n->id.x[c]); + snprintf(id + 2 * c, 3, "%02x", n->id.x[c]); id[sizeof id - 1] = 0; - send_request(c, "%d %d %s %s %s %d %d %d %d %x %x %s %s %d %hd %hd %hd %ld", CONTROL, REQ_DUMP_NODES, + send_request(c, "%d %d %s %s %s %d %d %d %d %x %x %s %s %d %d %d %d %ld", CONTROL, REQ_DUMP_NODES, n->name, id, n->hostname ?: "unknown port unknown", #ifdef DISABLE_LEGACY 0, 0, 0, diff --git a/src/protocol_misc.c b/src/protocol_misc.c index 5bbdc6c7..05a4adaa 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -135,7 +135,7 @@ bool send_tcppacket(connection_t *c, const vpn_packet_t *packet) { if(2.0 * c->outbuf.len / (float)maxoutbufsize - 1 > (float)rand()/(float)RAND_MAX) return true; - if(!send_request(c, "%d %hd", PACKET, packet->len)) + if(!send_request(c, "%d %d", PACKET, packet->len)) return false; return send_meta(c, (char *)DATA(packet), packet->len); diff --git a/src/sptps_test.c b/src/sptps_test.c index 3a72f1d6..8df10461 100644 --- a/src/sptps_test.c +++ b/src/sptps_test.c @@ -59,7 +59,7 @@ static bool send_data(void *handle, uint8_t type, const void *data, size_t len) static bool receive_record(void *handle, uint8_t type, const void *data, uint16_t len) { if(verbose) - fprintf(stderr, "Received type %d record of %hu bytes:\n", type, len); + fprintf(stderr, "Received type %d record of %u bytes:\n", type, len); if(!writeonly) write(out, data, len); return true; diff --git a/src/subnet_parse.c b/src/subnet_parse.c index 611d6bd4..c5f6976f 100644 --- a/src/subnet_parse.c +++ b/src/subnet_parse.c @@ -372,7 +372,7 @@ bool net2str(char *netstr, int len, const subnet_t *subnet) { result = snprintf(netstr, len, *format, ":::"); i += max_zero_length; } else { - result = snprintf(netstr, len, "%hx:", ntohs(subnet->net.ipv6.address.x[i])); + result = snprintf(netstr, len, "%x:", ntohs(subnet->net.ipv6.address.x[i])); i++; } netstr += result; diff --git a/src/tincctl.c b/src/tincctl.c index 0309cd48..9eb9a1b0 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1174,7 +1174,7 @@ static int cmd_dump(int argc, char *argv[]) { } else { if(only_reachable && !status.reachable) continue; - printf("%s id %s at %s port %s cipher %d digest %d maclength %d compression %d options %x status %04x nexthop %s via %s distance %d pmtu %hd (min %hd max %hd)\n", + printf("%s id %s at %s port %s cipher %d digest %d maclength %d compression %d options %x status %04x nexthop %s via %s distance %d pmtu %d (min %d max %d)\n", node, id, host, port, cipher, digest, maclength, compression, options, status_int, nexthop, via, distance, pmtu, minmtu, maxmtu); } } break;