]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - tools/purge/convert.cc
Policy: Include config.h first in all .cc
[thirdparty/squid.git] / tools / purge / convert.cc
index 64238121ce00049fed5a9701ff318dc51e74c8e2..590efa0c15092d0f8d49c804084c37006507f6a1 100644 (file)
@@ -1,3 +1,5 @@
+#include "config.h"
+
 //
 // $Id$
 //
@@ -74,7 +76,7 @@ my_inet_ntoa( const struct in_addr& a, HostAddress output )
         unsigned char s[sizeof(a.s_addr)];
         memcpy( s, &a.s_addr, sizeof(a.s_addr) );
 
-        sprintf( output, "%d.%d.%d.%d", s[0], s[1], s[2], s[3] );
+        snprintf(output, sizeof(HostAddress), "%d.%d.%d.%d", s[0], s[1], s[2], s[3] );
     }
     return output;
 }
@@ -87,7 +89,7 @@ my_sock_ntoa( const struct sockaddr_in& a, SockAddress buffer )
 // returns: pointer to buffer
 {
     HostAddress host;
-    sprintf( buffer, "%s:%u",
+    snprintf( buffer, sizeof(SockAddress), "%s:%u",
              my_inet_ntoa(a.sin_addr,host), ntohs(a.sin_port) );
     return buffer;
 }