[quagga-dev 4363] bgpd printf size_t warning

Andrew J. Schorr aschorr at telemetry-investments.com
Tue Sep 19 14:57:34 BST 2006


Any reason not to apply this trivial patch?  It seems like it was
more work to have added the "XXX: warning" message than to patch
the problem.  Or am I missing something subtle?

Index: bgpd/bgpd.c
===================================================================
RCS file: /var/cvsroot/quagga/bgpd/bgpd.c,v
retrieving revision 1.34
diff -b -u -p -r1.34 bgpd.c
--- bgpd/bgpd.c	14 Sep 2006 03:02:02 -0000	1.34
+++ bgpd/bgpd.c	19 Sep 2006 13:56:34 -0000
@@ -4250,8 +4250,7 @@ peer_uptime (time_t uptime2, char *buf, 
   /* Check buffer length. */
   if (len < BGP_UPTIME_LEN)
     {
-      /* XXX: warning: long int format, size_t arg (arg 2) */
-      zlog_warn ("peer_uptime (): buffer shortage %ld", len);
+      zlog_warn ("peer_uptime (): buffer shortage %lu", (u_long)len);
       /* XXX: should return status instead of buf... */
       snprintf (buf, len, "<error> "); 
       return buf;

Regards,
Andy



More information about the Quagga-dev mailing list