From cb170cb225e62f6deda4911f0fbab2d6cd6b8062 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 1 Jul 2000 16:52:55 +1000 Subject: - (djm) Added check for broken snprintf() functions which do not correctly terminate output string and attempt to use replacement. --- configure.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 8e155f26b..dbc5a18ee 100644 --- a/configure.in +++ b/configure.in @@ -235,6 +235,23 @@ AC_CHECK_FUNC(getpagesize, [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] ) +# Check for broken snprintf +if test "x$ac_cv_func_snprintf" = "xyes" ; then + AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) + AC_TRY_RUN( + [ +#include +int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} + ], + [AC_MSG_RESULT(yes)], + [ + AC_MSG_RESULT(no) + AC_DEFINE(BROKEN_SNPRINTF) + AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) + ] + ) +fi + PAM_MSG="no" AC_ARG_WITH(pam, [ --without-pam Disable PAM support ], -- cgit v1.2.3