Eliminate some uses of variables as format strings. Based on a patch
authorGreg Hudson <ghudson@mit.edu>
Mon, 3 May 2010 19:42:29 +0000 (19:42 +0000)
committerGreg Hudson <ghudson@mit.edu>
Mon, 3 May 2010 19:42:29 +0000 (19:42 +0000)
from Guillaume Rousse <Guillaume.Rousse@inria.fr>.

ticket: 6714

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23963 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/klist/klist.c
src/clients/ksu/ccache.c
src/kadmin/dbutil/kdb5_stash.c
src/lib/rpc/unit-test/rpc_test_svc.c
src/slave/kprop.c
src/slave/kpropd.c

index 8e2da5c77139bad3afb92fd7497e476da83d7409..32cf4d0a41d50209b9ff469d547d9224185b1241 100644 (file)
@@ -487,7 +487,7 @@ printtime(tv)
                                     timestring,
                                     timestamp_width+1,
                                     &fill)) {
-        printf(timestring);
+        printf("%s", timestring);
     }
 }
 
index 786a1751c54282f8da2c0aca7de9c6d679d247ed..51926235126545269c92605f887463f9f44c6db4 100644 (file)
@@ -355,7 +355,7 @@ void printtime(tv)
                                     fmtbuf,
                                     sizeof(fmtbuf),
                                     &fill))
-        printf(fmtbuf);
+        printf("%s", fmtbuf);
 }
 
 
index c04f006af0a17f9bbfe83070e2a5423e397fd53f..858cf58dc4db7f36233d80492a37dd98c20a3442 100644 (file)
@@ -122,7 +122,7 @@ kdb5_stash(argc, argv)
             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;
     }
 
index 61b51e08b48e26a7bfe3fa5cb64f18407edf3d66..88939f0a95386dc17951d2aa696915e415a3f5d2 100644 (file)
 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 @@ rpc_test_prog_1_svc(rqstp, transp)
                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--;
index dffb99aa8833b3b4ca096f3c9383f20a57b09aec..764b0f46be49a69f4801cf0f9b01d12d61c87531 100644 (file)
@@ -591,7 +591,7 @@ xmit_database(context, auth_context, my_creds, fd, database_fd,
             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);
         }
index e3bcd689ac5ba278cde82b4c7fb39bd0afe9887f..f669d8bbbd97f83755981c515804fd0f0625a596 100644 (file)
@@ -1445,7 +1445,7 @@ recv_database(context, fd, database_fd, confmsg)
             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 @@ recv_database(context, fd, database_fd, confmsg)
             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);