Commit 54db98c2 authored by Yang Tse's avatar Yang Tse
Browse files

compiler warning fix

parent 5565f45f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -357,6 +357,7 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
static char *ares_striendstr(const char *s1, const char *s2)
{
  const char *c1, *c2, *c1_begin;
  int lo1, lo2;
  size_t s1_len = strlen(s1), s2_len = strlen(s2);

  /* If the substr is longer than the full str, it can't match */
@@ -369,7 +370,9 @@ static char *ares_striendstr(const char *s1, const char *s2)
  c2 = s2;
  while (c2 < s2+s2_len)
    {
      if (tolower(*c1) != tolower(*c2))
      lo1 = tolower(*c1);
      lo2 = tolower(*c2);
      if (lo1 != lo2)
        return NULL;
      else
        {
+3 −3
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
   */
  gettimeofday(&tv, NULL);
  channel->next_id = (unsigned short)
    (tv.tv_sec ^ tv.tv_usec ^ getpid()) & 0xffff;
    ((tv.tv_sec ^ tv.tv_usec ^ getpid()) & 0xffff);

  channel->queries = NULL;

@@ -893,7 +893,7 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
                                     sizeof(pat.addr.addr6))) > 0)
        {
          pat.type = PATTERN_CIDR;
          pat.mask.bits = bits;
          pat.mask.bits = (unsigned short)bits;
          pat.family = AF_INET6;
          if (!sortlist_alloc(sortlist, nsort, &pat))
            return ARES_ENOMEM;
@@ -903,7 +903,7 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
                                     sizeof(pat.addr.addr4))) > 0)
        {
          pat.type = PATTERN_CIDR;
          pat.mask.bits = bits;
          pat.mask.bits = (unsigned short)bits;
          pat.family = AF_INET;
          if (!sortlist_alloc(sortlist, nsort, &pat))
            return ARES_ENOMEM;
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
        return ARES_EBADNAME;

      /* Encode the length and copy the data. */
      *q++ = len;
      *q++ = (unsigned char)len;
      for (p = name; *p && *p != '.'; p++)
        {
          if (*p == '\\' && *(p + 1) != 0)
+2 −2
Original line number Diff line number Diff line
@@ -79,8 +79,8 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
  /* Form the TCP query buffer by prepending qlen (as two
   * network-order bytes) to qbuf.
   */
  query->tcpbuf[0] = (qlen >> 8) & 0xff;
  query->tcpbuf[1] = qlen & 0xff;
  query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
  query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
  memcpy(query->tcpbuf + 2, qbuf, qlen);
  query->tcplen = qlen + 2;

+6 −6
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ getv4(const char *src, unsigned char *dst, int *bitsp)
    if (ch == '.' || ch == '/') {
      if (dst - odst > 3)             /* too many octets? */
        return (0);
      *dst++ = val;
      *dst++ = (unsigned char)val;
      if (ch == '/')
        return (getbits(src, bitsp));
      val = 0;
@@ -265,7 +265,7 @@ getv4(const char *src, unsigned char *dst, int *bitsp)
    return (0);
  if (dst - odst > 3)             /* too many octets? */
    return (0);
  *dst++ = val;
  *dst++ = (unsigned char)val;
  return (1);
}

@@ -321,8 +321,8 @@ inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
        goto enoent;
      if (tp + NS_INT16SZ > endp)
        return (0);
      *tp++ = (unsigned char) (val >> 8) & 0xff;
      *tp++ = (unsigned char) val & 0xff;
      *tp++ = (unsigned char)((val >> 8) & 0xff);
      *tp++ = (unsigned char)(val & 0xff);
      saw_xdigit = 0;
      digits = 0;
      val = 0;
@@ -342,8 +342,8 @@ inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size)
  if (saw_xdigit) {
    if (tp + NS_INT16SZ > endp)
      goto enoent;
    *tp++ = (unsigned char) (val >> 8) & 0xff;
    *tp++ = (unsigned char) val & 0xff;
    *tp++ = (unsigned char)((val >> 8) & 0xff);
    *tp++ = (unsigned char)(val & 0xff);
  }
  if (bits == -1)
    bits = 128;
Loading