diff options
author | Damien Miller <djm@mindrot.org> | 2000-07-01 16:52:55 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-07-01 16:52:55 +1000 |
commit | cb170cb225e62f6deda4911f0fbab2d6cd6b8062 (patch) | |
tree | 003880eaf4ddfda40e01a1baee5f2d85f69e2704 /configure.in | |
parent | 28adeef966d890b5831d831b1f0e1100c9db5b0a (diff) |
- (djm) Added check for broken snprintf() functions which do not correctly
terminate output string and attempt to use replacement.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 8e155f26..dbc5a18e 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 <stdio.h> +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 ], |