From: Greg Hudson Date: Mon, 3 May 2010 19:42:29 +0000 (+0000) Subject: Eliminate some uses of variables as format strings. Based on a patch X-Git-Tag: krb5-1.9-beta1~254 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58b7028315ce2f7a1be27cee8b463d0df4b500e4;p=krb5.git Eliminate some uses of variables as format strings. Based on a patch from Guillaume Rousse . ticket: 6714 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23963 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index 8e2da5c77..32cf4d0a4 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -487,7 +487,7 @@ printtime(tv) timestring, timestamp_width+1, &fill)) { - printf(timestring); + printf("%s", timestring); } } diff --git a/src/clients/ksu/ccache.c b/src/clients/ksu/ccache.c index 786a1751c..519262351 100644 --- a/src/clients/ksu/ccache.c +++ b/src/clients/ksu/ccache.c @@ -355,7 +355,7 @@ void printtime(tv) fmtbuf, sizeof(fmtbuf), &fill)) - printf(fmtbuf); + printf("%s", fmtbuf); } diff --git a/src/kadmin/dbutil/kdb5_stash.c b/src/kadmin/dbutil/kdb5_stash.c index c04f006af..858cf58dc 100644 --- a/src/kadmin/dbutil/kdb5_stash.c +++ b/src/kadmin/dbutil/kdb5_stash.c @@ -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; } diff --git a/src/lib/rpc/unit-test/rpc_test_svc.c b/src/lib/rpc/unit-test/rpc_test_svc.c index 61b51e08b..88939f0a9 100644 --- a/src/lib/rpc/unit-test/rpc_test_svc.c +++ b/src/lib/rpc/unit-test/rpc_test_svc.c @@ -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 @@ 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--; diff --git a/src/slave/kprop.c b/src/slave/kprop.c index dffb99aa8..764b0f46b 100644 --- a/src/slave/kprop.c +++ b/src/slave/kprop.c @@ -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); } diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index e3bcd689a..f669d8bbb 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -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);