In C when declaring a variable on the stack, it is assigned
what ever happens to be on the stack at the place the variable
is accessed in memory from previous usage.  Let's explicitly call out a
value instead of using whatever happens to be on the stack
at the point of creation of the sav value.

Signed-off-by: Donald Sharp <donaldshar...@gmail.com>
---
 src/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util.c b/src/util.c
index f058c92..02aa76b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -560,7 +560,7 @@ int parse_hex(char *in, unsigned char *out, int maxlen,
                  int j, bytes = (1 + (r - in))/2;
                  for (j = 0; j < bytes; j++)
                    { 
-                     char sav = sav;
+                     char sav = 0;
                      if (j < bytes - 1)
                        {
                          sav = in[(j+1)*2];
-- 
2.25.0


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

Reply via email to