/*
- * "$Id: debug.c 11558 2014-02-06 18:33:34Z msweet $"
+ * "$Id: debug.c 12328 2014-12-09 20:38:47Z msweet $"
*
* Debugging functions for CUPS.
*
type; /* Format type character */
int width, /* Width of field */
prec; /* Number of characters of precision */
- char tformat[100], /* Temporary format string for sprintf() */
+ char tformat[100], /* Temporary format string for snprintf() */
*tptr, /* Pointer into temporary format */
temp[1024]; /* Buffer for formatted numbers */
char *s; /* Pointer to string */
if ((size_t)(width + 2) > sizeof(temp))
break;
- sprintf(temp, tformat, va_arg(ap, double));
+ snprintf(temp, sizeof(temp), tformat, va_arg(ap, double));
bytes += (int)strlen(temp);
# ifdef HAVE_LONG_LONG
if (size == 'L')
- sprintf(temp, tformat, va_arg(ap, long long));
+ snprintf(temp, sizeof(temp), tformat, va_arg(ap, long long));
else
# endif /* HAVE_LONG_LONG */
if (size == 'l')
- sprintf(temp, tformat, va_arg(ap, long));
+ snprintf(temp, sizeof(temp), tformat, va_arg(ap, long));
else
- sprintf(temp, tformat, va_arg(ap, int));
+ snprintf(temp, sizeof(temp), tformat, va_arg(ap, int));
bytes += (int)strlen(temp);
if ((size_t)(width + 2) > sizeof(temp))
break;
- sprintf(temp, tformat, va_arg(ap, void *));
+ snprintf(temp, sizeof(temp), tformat, va_arg(ap, void *));
bytes += (int)strlen(temp);
/*
- * End of "$Id: debug.c 11558 2014-02-06 18:33:34Z msweet $".
+ * End of "$Id: debug.c 12328 2014-12-09 20:38:47Z msweet $".
*/