svn rev #23963: trunk/src/ clients/klist/ clients/ksu/ kadmin/dbutil/ lib/rpc/unit-test/ ...

ghudson@MIT.EDU ghudson at MIT.EDU
Mon May 3 15:42:29 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=23963
Commit By: ghudson
Log Message:
ticket: 6714

Eliminate some uses of variables as format strings.  Based on a patch
from Guillaume Rousse <Guillaume.Rousse at inria.fr>.



Changed Files:
U   trunk/src/clients/klist/klist.c
U   trunk/src/clients/ksu/ccache.c
U   trunk/src/kadmin/dbutil/kdb5_stash.c
U   trunk/src/lib/rpc/unit-test/rpc_test_svc.c
U   trunk/src/slave/kprop.c
U   trunk/src/slave/kpropd.c
Modified: trunk/src/clients/klist/klist.c
===================================================================
--- trunk/src/clients/klist/klist.c	2010-05-03 19:02:16 UTC (rev 23962)
+++ trunk/src/clients/klist/klist.c	2010-05-03 19:42:29 UTC (rev 23963)
@@ -487,7 +487,7 @@
                                     timestring,
                                     timestamp_width+1,
                                     &fill)) {
-        printf(timestring);
+        printf("%s", timestring);
     }
 }
 

Modified: trunk/src/clients/ksu/ccache.c
===================================================================
--- trunk/src/clients/ksu/ccache.c	2010-05-03 19:02:16 UTC (rev 23962)
+++ trunk/src/clients/ksu/ccache.c	2010-05-03 19:42:29 UTC (rev 23963)
@@ -355,7 +355,7 @@
                                     fmtbuf,
                                     sizeof(fmtbuf),
                                     &fill))
-        printf(fmtbuf);
+        printf("%s", fmtbuf);
 }
 
 

Modified: trunk/src/kadmin/dbutil/kdb5_stash.c
===================================================================
--- trunk/src/kadmin/dbutil/kdb5_stash.c	2010-05-03 19:02:16 UTC (rev 23962)
+++ trunk/src/kadmin/dbutil/kdb5_stash.c	2010-05-03 19:42:29 UTC (rev 23963)
@@ -122,7 +122,7 @@
             com_err(progname, KRB5_PROG_KEYTYPE_NOSUPP,
                     "while setting up enctype %d", master_keyblock.enctype);
         else
-            com_err(progname, KRB5_PROG_KEYTYPE_NOSUPP, tmp);
+            com_err(progname, KRB5_PROG_KEYTYPE_NOSUPP, "%s", tmp);
         exit_status++; return;
     }
 

Modified: trunk/src/lib/rpc/unit-test/rpc_test_svc.c
===================================================================
--- trunk/src/lib/rpc/unit-test/rpc_test_svc.c	2010-05-03 19:02:16 UTC (rev 23962)
+++ trunk/src/lib/rpc/unit-test/rpc_test_svc.c	2010-05-03 19:42:29 UTC (rev 23963)
@@ -13,13 +13,6 @@
 static int _rpcsvcstate = _IDLE;	/* Set when a request is serviced */
 static int _rpcsvccount = 0;		/* Number of requests being serviced */
 
-static
-void _msgout(msg)
-	char *msg;
-{
-	syslog(LOG_ERR, msg);
-}
-
 void
 rpc_test_prog_1_svc(rqstp, transp)
 	struct svc_req *rqstp;
@@ -65,7 +58,7 @@
 		svcerr_systemerr(transp);
 	}
 	if (!svc_freeargs(transp, xdr_argument, &argument)) {
-		_msgout("unable to free arguments");
+		syslog(LOG_ERR, "unable to free arguments");
 		exit(1);
 	}
 	_rpcsvccount--;

Modified: trunk/src/slave/kprop.c
===================================================================
--- trunk/src/slave/kprop.c	2010-05-03 19:02:16 UTC (rev 23962)
+++ trunk/src/slave/kprop.c	2010-05-03 19:42:29 UTC (rev 23963)
@@ -591,7 +591,7 @@
             snprintf(buf, sizeof(buf),
                      "while encoding database block starting at %d",
                      sent_size);
-            com_err(progname, retval, buf);
+            com_err(progname, retval, "%s", buf);
             send_error(context, my_creds, fd, buf, retval);
             exit(1);
         }

Modified: trunk/src/slave/kpropd.c
===================================================================
--- trunk/src/slave/kpropd.c	2010-05-03 19:02:16 UTC (rev 23962)
+++ trunk/src/slave/kpropd.c	2010-05-03 19:42:29 UTC (rev 23963)
@@ -1445,7 +1445,7 @@
             snprintf(buf, sizeof(buf),
                      "while reading database block starting at offset %d",
                      received_size);
-            com_err(progname, retval, buf);
+            com_err(progname, retval, "%s", buf);
             send_error(context, fd, retval, buf);
             exit(1);
         }
@@ -1457,7 +1457,7 @@
             snprintf(buf, sizeof(buf),
                      "while decoding database block starting at offset %d",
                      received_size);
-            com_err(progname, retval, buf);
+            com_err(progname, retval, "%s", buf);
             send_error(context, fd, retval, buf);
             krb5_free_data_contents(context, &inbuf);
             exit(1);




More information about the cvs-krb5 mailing list