Found by clang-analyzer
---
 src/auth.c   | 4 ++--
 src/option.c | 4 ++--
 src/util.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/auth.c b/src/auth.c
index 7c68f8b..1a5eb21 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -597,7 +597,7 @@ size_t answer_auth(struct dns_header *header, char *limit, 
size_t qlen, time_t n
              if (subnet->prefixlen >= 16 )
                p += sprintf(p, "%u.", a & 0xff);
              a = a >> 8;
-             p += sprintf(p, "%u.in-addr.arpa", a & 0xff);
+             sprintf(p, "%u.in-addr.arpa", a & 0xff);
 
            }
 #ifdef HAVE_IPV6
@@ -611,7 +611,7 @@ size_t answer_auth(struct dns_header *header, char *limit, 
size_t qlen, time_t n
                  int dig = ((unsigned char *)&subnet->addr.addr.addr6)[i>>3];
                  p += sprintf(p, "%.1x.", (i>>2) & 1 ? dig & 15 : dig >> 4);
                }
-             p += sprintf(p, "ip6.arpa");
+             sprintf(p, "ip6.arpa");
 
            }
 #endif
diff --git a/src/option.c b/src/option.c
index 1feab22..1347b6b 100644
--- a/src/option.c
+++ b/src/option.c
@@ -897,7 +897,7 @@ static struct server *add_rev4(struct in_addr addr, int 
msize)
       return NULL;
     }
 
-  p += sprintf(p, "in-addr.arpa");
+  sprintf(p, "in-addr.arpa");
 
   serv->flags = SERV_HAS_DOMAIN;
   serv->next = daemon->servers;
@@ -921,7 +921,7 @@ static struct server *add_rev6(struct in6_addr *addr, int 
msize)
       int dig = ((unsigned char *)addr)[i>>3];
       p += sprintf(p, "%.1x.", (i>>2) & 1 ? dig & 15 : dig >> 4);
     }
-  p += sprintf(p, "ip6.arpa");
+  sprintf(p, "ip6.arpa");
 
   serv->flags = SERV_HAS_DOMAIN;
   serv->next = daemon->servers;
diff --git a/src/util.c b/src/util.c
index 5cff86f..aa00cef 100644
--- a/src/util.c
+++ b/src/util.c
@@ -472,7 +472,7 @@ void prettyprint_time(char *buf, unsigned int t)
       if ((x = (t/60)%60))
        p += sprintf(&buf[p], "%um", x);
       if ((x = t%60))
-       p += sprintf(&buf[p], "%us", x);
+            sprintf(&buf[p], "%us", x);
     }
 }
 
-- 
2.14.2


_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to