fix some obvious errors reported by the CLion Project Analyzer (#779)

Fix By: Gregor Jasny (@gjasny)
v1.29
Gregor Jasny 6 months ago committed by Brad House
parent e2f029ab8b
commit 145575d099
  1. 2
      src/lib/ares__buf.c
  2. 2
      src/lib/ares__htable_strvp.h
  3. 2
      src/lib/ares_getnameinfo.c
  4. 2
      test/ares-test-live.cc
  5. 2
      test/ares-test-misc.cc

@ -135,8 +135,6 @@ void ares__buf_reclaim(ares__buf_t *buf)
if (buf->tag_offset != SIZE_MAX) {
buf->tag_offset -= prefix_size;
}
return;
}
static ares_status_t ares__buf_ensure_space(ares__buf_t *buf,

@ -115,4 +115,4 @@ size_t ares__htable_strvp_num_keys(const ares__htable_strvp_t *htable);
/*! @} */
#endif /* __ARES__HTABLE_STVP_H */
#endif /* __ARES__HTABLE_STRVP_H */

@ -82,7 +82,7 @@ static char *lookup_service(unsigned short port, unsigned int flags, char *buf,
size_t buflen);
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
static void append_scopeid(const struct sockaddr_in6 *addr6,
unsigned int scopeid, char *buf, size_t buflen);
unsigned int flags, char *buf, size_t buflen);
#endif
static char *ares_striendstr(const char *s1, const char *s2);

@ -807,7 +807,7 @@ TEST_F(DefaultChannelTest, LiveSetServersPorts) {
server2.family = AF_INET;
server2.addr.addr4.s_addr = htonl(0x02030405);
server2.udp_port = 0;
server2.tcp_port = 0;;
server2.tcp_port = 0;
EXPECT_EQ(ARES_ENODATA, ares_set_servers_ports(nullptr, &server1));
// Change while pending will requeue any requests to new servers

@ -104,7 +104,7 @@ TEST_F(DefaultChannelTest, SetServersPorts) {
server2.family = AF_INET;
server2.addr.addr4.s_addr = htonl(0x02030405);
server2.udp_port = 0;
server2.tcp_port = 0;;
server2.tcp_port = 0;
EXPECT_EQ(ARES_ENODATA, ares_set_servers_ports(nullptr, &server1));
EXPECT_EQ(ARES_SUCCESS, ares_set_servers_ports(channel_, &server1));

Loading…
Cancel
Save