summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2003-08-07 20:48:10 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2003-08-07 20:48:10 +0000
commit4d2921959eb1c3c44809089d238cdc831c746ab2 (patch)
treeca584a893e698b00fe197097e059fb35242556eb /acinclude.m4
parentd695d28b1b2551145f294d605751a911c015f9c0 (diff)
Tighten the snprintf() test to check behaviour on zero-size buffers.
2003-08-07 Matthias Clasen <maclas@gmx.de> * acinclude.m4: Tighten the snprintf() test to check behaviour on zero-size buffers. (#106091)
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m445
1 files changed, 16 insertions, 29 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index ed90b97fa..4d0180163 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -66,6 +66,16 @@ doit()
if (r != 7)
exit(1);
+ r = snprintf(buffer, 0, "1234567");
+
+ if (r != 7)
+ exit(1);
+
+ r = snprintf(NULL, 0, "1234567");
+
+ if (r != 7)
+ exit(1);
+
exit(0);
}
@@ -116,40 +126,17 @@ if test $ac_cv_func_printf_unix98 = yes; then
fi
])# AC_FUNC_PRINTF_UNIX98
-# Checks the location of the XML Catalog
-# Usage:
-# JH_PATH_XML_CATALOG
-# Defines XMLCATALOG and XML_CATALOG_FILE substitutions
-AC_DEFUN([JH_PATH_XML_CATALOG],
-[
- # check for the presence of the XML catalog
- AC_ARG_WITH([xml-catalog],
- AC_HELP_STRING([--with-xml-catalog=CATALOG],
- [path to xml catalog to use]),,
- [with_xml_catalog=/etc/xml/catalog])
- XML_CATALOG_FILE="$with_xml_catalog"
- AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
- if test -f "$XML_CATALOG_FILE"; then
- AC_MSG_RESULT([found])
- else
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([XML catalog not found])
- fi
- AC_SUBST([XML_CATALOG_FILE])
-
- # check for the xmlcatalog program
- AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
- if test "x$XMLCATALOG" = xno; then
- AC_MSG_ERROR([could not find xmlcatalog program])
- fi
-])
-
# Checks if a particular URI appears in the XML catalog
# Usage:
# JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
AC_DEFUN([JH_CHECK_XML_CATALOG],
[
- AC_REQUIRE([JH_PATH_XML_CATALOG])dnl
+ AC_ARG_WITH([xml-catalog],
+ AC_HELP_STRING([--with-xml-catalog=CATALOG],
+ [path to xml catalog to use]),,
+ [with_xml_catalog=/etc/xml/catalog])
+ XML_CATALOG_FILE="$with_xml_catalog"
+ AC_PATH_PROG(XMLCATALOG, xmlcatalog, /bin/false)
AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
if AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
AC_MSG_RESULT([found])