From 4de0caf94d2a513e3f9e970933a162f32d5519f1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 18 May 2007 17:45:52 +0000 Subject: [PATCH] Work around broken snprintf function on BeOS. --- ChangeLog | 4 ++++ lib/vasnprintf.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4d5569bc2..41e6cb24f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-18 Bruno Haible + * lib/vasnprintf.c (USE_SNPRINTF): Define to 0 on BeOS. + +2007-05-18 Bruno Haible + * lib/vasnprintf.m4 (VASNPRINTF) [WIN32]: Use %I64d instead of %lld for printing 64-bit integers. Needed for mingw. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 2c4b42110..a740ebf65 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -111,7 +111,14 @@ local_wcslen (const wchar_t *s) # define DIRECTIVE char_directive # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse -# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) +# /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'. + But don't use it on BeOS, since BeOS snprintf produces no output if the + size argument is >= 0x3000000. */ +# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ +# define USE_SNPRINTF 1 +# else +# define USE_SNPRINTF 0 +# endif # if HAVE_DECL__SNPRINTF /* Windows. */ # define SNPRINTF _snprintf -- 2.11.0