#include <ctype.h>
#include <sys/types.h>
#include "lib/str.h"
+#include "lib/debug.h"
/* Define this as a fall through, HAVE_STDARG_H is probably already set */
value = "<NULL>";
}
- for (strln = 0; value[strln]; ++strln); /* mutt_strlen */
+ for (strln = 0; value[strln]; ++strln); /* safe_strlen */
padlen = min - strln;
if (padlen < 0)
padlen = 0;
spadlen = -spadlen; /* Left Justifty */
#ifdef DEBUG_SNPRINTF
- dprint (1, (debugfile, "zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
+ debug_print (1, ("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
zpadlen, spadlen, min, max, place));
#endif
}
#ifdef DEBUG_SNPRINTF
- dprint (1, (debugfile, "fmtfp: %f =? %d.%d\n", fvalue, intpart, fracpart));
+ debug_print (1, ("fmtfp: %f =? %d.%d\n", fvalue, intpart, fracpart));
#endif
/* Convert integer part */
{
str[0] = 0;
dopr (str, count, fmt, args);
- return (mutt_strlen (str));
+ return (safe_strlen (str));
}
#endif /* !HAVE_VSNPRINTF */
(void) vsnprintf (str, count, fmt, ap);
VA_END;
- return (mutt_strlen (str));
+ return (safe_strlen (str));
}
#ifdef TEST_SNPRINTF
for (y = 0; fp_nums[y] != 0; y++) {
snprintf (buf1, sizeof (buf1), fp_fmt[x], fp_nums[y]);
sprintf (buf2, fp_fmt[x], fp_nums[y]);
- if (mutt_strcmp (buf1, buf2)) {
+ if (safe_strcmp (buf1, buf2)) {
printf ("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", /* __SPRINTF_CHECKED__ */
fp_fmt[x], buf1, buf2);
fail++;
for (y = 0; int_nums[y] != 0; y++) {
snprintf (buf1, sizeof (buf1), int_fmt[x], int_nums[y]);
sprintf (buf2, int_fmt[x], int_nums[y]);
- if (mutt_strcmp (buf1, buf2)) {
+ if (safe_strcmp (buf1, buf2)) {
printf ("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", /* __SPRINTF_CHECKED__ */
int_fmt[x], buf1, buf2);
fail++;