]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Use bsprintf() instead of sprintf().
authorMartin Mares <mj@ucw.cz>
Fri, 31 Mar 2000 23:33:03 +0000 (23:33 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 31 Mar 2000 23:33:03 +0000 (23:33 +0000)
TODO
lib/ipv6.c
lib/resource.c
proto/rip/rip.c
sysdep/unix/io.c

diff --git a/TODO b/TODO
index 55f943056536a8f0617b4689eba5ecaa052da290..d3290e8a43af5bec6ed0d208b76fbcc8a797b113 100644 (file)
--- a/TODO
+++ b/TODO
@@ -36,6 +36,7 @@ Globals
 - protocols: implement CLI hooks and per-procotol CLI commands
 - protocols: implement reconfigure hook
 - protocols: use locking
+- check use of system includes and sprintf()
 
 Various ideas
 ~~~~~~~~~~~~~
index 9f49be3aa9356bc8db20569667fbcc64710662cd..b533c58cd2f5b194951e6c90a9eb32736df88b91 100644 (file)
@@ -167,12 +167,12 @@ ip_ntop(ip_addr a, char *b)
        bestlen == 6))
     {
       u32 x = a.addr[3];
-      b += sprintf(b, "::%s%d.%d.%d.%d",
-                  a.addr[2] ? "ffff:" : "",
-                  ((x >> 24) & 0xff),
-                  ((x >> 16) & 0xff),
-                  ((x >> 8) & 0xff),
-                  (x & 0xff));
+      b += bsprintf(b, "::%s%d.%d.%d.%d",
+                   a.addr[2] ? "ffff:" : "",
+                   ((x >> 24) & 0xff),
+                   ((x >> 16) & 0xff),
+                   ((x >> 8) & 0xff),
+                   (x & 0xff));
       return b;
     }
 
@@ -190,7 +190,7 @@ ip_ntop(ip_addr a, char *b)
        {
          if (i)
            *b++ = ':';
-         b += sprintf(b, "%x", words[i]);
+         b += bsprintf(b, "%x", words[i]);
        }
     }
   *b = 0;
@@ -206,7 +206,7 @@ ip_ntox(ip_addr a, char *b)
     {
       if (i)
        *b++ = '.';
-      b += sprintf(b, "%08x", a.addr[i]);
+      b += bsprintf(b, "%08x", a.addr[i]);
     }
   return b;
 }
index 98bfe4e15b49a9fe23f2f07682717adf7c70a599..e67c05a5a589171c2f3955d838bc0579c1c83f36 100644 (file)
@@ -90,7 +90,7 @@ rdump(void *res)
   char x[16];
   resource *r = res;
 
-  sprintf(x, "%%%ds%%08x ", indent);
+  bsprintf(x, "%%%ds%%08x ", indent);
   debug(x, "", (int) r);
   if (r)
     {
index 4634ae1fae9498751c998d905d132ecf02f07c11..e885877dfc0fc048163f531d99b8506d6112b470 100644 (file)
@@ -504,8 +504,8 @@ rip_dump(struct proto *p)
 static void
 rip_get_route_info(rte *rte, byte *buf)
 {
-  buf += sprintf(buf, " (%d/%d)", rte->pref, rte->u.rip.metric );
-  sprintf(buf, " t%04x", rte->u.rip.tag );
+  buf += bsprintf(buf, " (%d/%d)", rte->pref, rte->u.rip.metric );
+  bsprintf(buf, " t%04x", rte->u.rip.tag );
 }
 
 static int
index 1ee1c073861ef259cacc641e2e2cae13a995e425..7857a272eddb33c26ce5ea39bffce855dc8f5b5c 100644 (file)
@@ -288,7 +288,7 @@ tm_format_date(char *x, bird_clock_t t)
   struct tm *tm;
 
   tm = localtime(&t);
-  sprintf(x, "%02d-%02d-%04d", tm->tm_mday, tm->tm_mon+1, tm->tm_year+1900);
+  bsprintf(x, "%02d-%02d-%04d", tm->tm_mday, tm->tm_mon+1, tm->tm_year+1900);
 }
 
 void