summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-08-03 00:43:38 +0200
committerKevin Ryde <user42@zip.com.au>2001-08-03 00:43:38 +0200
commit295f257a58fa08ab9f99bbe809aa0e2679a6628d (patch)
tree457592a6d2df5679bb70fc16e1a7367f53d77a39 /aclocal.m4
parent5e113182c29d5f1bab042c6168340fb993ed6141 (diff)
downloadgmp-295f257a58fa08ab9f99bbe809aa0e2679a6628d.tar.gz
Regenerate
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m418
1 files changed, 9 insertions, 9 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 440dba14f..12afb8725 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1652,12 +1652,9 @@ dnl
dnl SunOS 4 (or some versions at least) have vsnprintf as an alias for
dnl vsprintf, which is completely useless.
dnl
-dnl FIXME: Some glibc 2.0.x versions of snprintf return -1 for buffer
-dnl overflow (and put a null-terminated string), eg. on redhat 5.2. It
-dnl doesn't seem wise to allow -1 in general, in case that indicates a
-dnl fatal error and only garbage has been produced, sending us into an
-dnl infinite loop in gmp_snprintf. But if we were sure that wouldn't
-dnl happen then we could allow -1 here (and in the printf/*.c code).
+dnl glibc 2.0.x returns either -1 or bufsize-1 for an overflow (both seen,
+dnl not sure which 2.0.x does which), but still puts the correct null
+dnl terminated result into the buffer.
AC_DEFUN(GMP_FUNC_VSNPRINTF,
[AC_REQUIRE([GMP_C_STDARG])
@@ -1694,16 +1691,19 @@ check (va_alist)
#endif
ret = vsnprintf (buf, 4, fmt, ap);
- if (ret == -1)
+
+ if (strcmp (buf, "hel") != 0)
exit (1);
- if (strlen (buf) > 3)
+
+ /* allowed return values */
+ if (ret != -1 && ret != 3 && ret != 11)
exit (2);
}
int
main ()
{
- check ("hello world\n");
+ check ("hello world");
exit (0);
}
],