summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 18 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index d93cc6b49..d5b4377b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.581 2014/08/22 08:06:21 djm Exp $ 1# $Id: configure.ac,v 1.582 2014/08/23 07:06:49 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) 17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
18AC_REVISION($Revision: 1.581 $) 18AC_REVISION($Revision: 1.582 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20AC_LANG([C]) 20AC_LANG([C])
21 21
@@ -1887,11 +1887,9 @@ if test "x$ac_cv_func_snprintf" = "xyes" ; then
1887 ) 1887 )
1888fi 1888fi
1889 1889
1890# If we don't have a working asprintf, then we strongly depend on vsnprintf 1890# We depend on vsnprintf returning the right thing on overflow: the
1891# returning the right thing on overflow: the number of characters it tried to 1891# number of characters it tried to create (as per SUSv3)
1892# create (as per SUSv3) 1892if test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1893if test "x$ac_cv_func_asprintf" != "xyes" && \
1894 test "x$ac_cv_func_vsnprintf" = "xyes" ; then
1895 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow]) 1893 AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
1896 AC_RUN_IFELSE( 1894 AC_RUN_IFELSE(
1897 [AC_LANG_PROGRAM([[ 1895 [AC_LANG_PROGRAM([[
@@ -1899,15 +1897,23 @@ if test "x$ac_cv_func_asprintf" != "xyes" && \
1899#include <stdio.h> 1897#include <stdio.h>
1900#include <stdarg.h> 1898#include <stdarg.h>
1901 1899
1902int x_snprintf(char *str,size_t count,const char *fmt,...) 1900int x_snprintf(char *str, size_t count, const char *fmt, ...)
1903{ 1901{
1904 size_t ret; va_list ap; 1902 size_t ret;
1905 va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap); 1903 va_list ap;
1904
1905 va_start(ap, fmt);
1906 ret = vsnprintf(str, count, fmt, ap);
1907 va_end(ap);
1906 return ret; 1908 return ret;
1907} 1909}
1908 ]], [[ 1910 ]], [[
1909 char x[1]; 1911char x[1];
1910 exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1); 1912if (x_snprintf(x, 1, "%s %d", "hello", 12345) != 11)
1913 return 1;
1914if (x_snprintf(NULL, 0, "%s %d", "hello", 12345) != 11)
1915 return 1;
1916return 0;
1911 ]])], 1917 ]])],
1912 [AC_MSG_RESULT([yes])], 1918 [AC_MSG_RESULT([yes])],
1913 [ 1919 [