Always use vsprintf
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1094 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -11,27 +11,14 @@ RCSID("$Id$");
|
|||||||
* log: Make a log entry
|
* log: Make a log entry
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static char msgbuf[MAXLINELEN];
|
|
||||||
|
|
||||||
int
|
int
|
||||||
pop_log(POP *p, int stat, char *format, ...)
|
pop_log(POP *p, int stat, char *format, ...)
|
||||||
{
|
{
|
||||||
|
static char msgbuf[MAXLINELEN];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
#ifdef HAVE_VSPRINTF
|
vsprintf(msgbuf,format,ap);
|
||||||
vsprintf(msgbuf,format,ap);
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
int a0 = va_arg(ap, int);
|
|
||||||
int a1 = va_arg(ap, int);
|
|
||||||
int a2 = va_arg(ap, int);
|
|
||||||
int a3 = va_arg(ap, int);
|
|
||||||
int a4 = va_arg(ap, int);
|
|
||||||
int a5 = va_arg(ap, int);
|
|
||||||
sprintf(msgbuf, format, a0, a1, a2, a3, a4, a5, 0, 4711);
|
|
||||||
}
|
|
||||||
#endif /* HAVE_VSPRINTF */
|
|
||||||
|
|
||||||
if (p->debug && p->trace) {
|
if (p->debug && p->trace) {
|
||||||
fprintf(p->trace,"%s\n",msgbuf);
|
fprintf(p->trace,"%s\n",msgbuf);
|
||||||
|
@@ -34,19 +34,7 @@ pop_msg(POP *p, int stat, char *format, ...)
|
|||||||
|
|
||||||
/* Append the message (formatted, if necessary) */
|
/* Append the message (formatted, if necessary) */
|
||||||
if (format)
|
if (format)
|
||||||
#ifdef HAVE_VSPRINTF
|
|
||||||
vsprintf(mp,format,ap);
|
vsprintf(mp,format,ap);
|
||||||
#else
|
|
||||||
{
|
|
||||||
int a0 = va_arg(ap, int);
|
|
||||||
int a1 = va_arg(ap, int);
|
|
||||||
int a2 = va_arg(ap, int);
|
|
||||||
int a3 = va_arg(ap, int);
|
|
||||||
int a4 = va_arg(ap, int);
|
|
||||||
int a5 = va_arg(ap, int);
|
|
||||||
sprintf(mp, format, a0, a1, a2, a3, a4, a5, 0, 4711);
|
|
||||||
}
|
|
||||||
#endif /* HAVE_VSPRINTF */
|
|
||||||
|
|
||||||
/* Log the message if debugging is turned on */
|
/* Log the message if debugging is turned on */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
Reference in New Issue
Block a user