bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*printf: fix for BeOS


From: Bruno Haible
Subject: *printf: fix for BeOS
Date: Fri, 18 May 2007 19:43:40 +0200
User-agent: KMail/1.5.4

The snprintf function on BeOS produces no output if the specified size is
>= 0x3000000. Since gnulib's sprintf.c passed a size of 0x7fffffff, it
fully hits this bug.

The workaround is to use the native sprintf instead.


2007-05-18  Bruno Haible  <address@hidden>

        * lib/vasnprintf.c (USE_SNPRINTF): Define to 0 on BeOS.

*** lib/vasnprintf.c    18 May 2007 17:35:19 -0000      1.43
--- lib/vasnprintf.c    18 May 2007 17:41:21 -0000
***************
*** 111,117 ****
  # define DIRECTIVE char_directive
  # define DIRECTIVES char_directives
  # define PRINTF_PARSE printf_parse
! # define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
  # if HAVE_DECL__SNPRINTF
     /* Windows.  */
  #  define SNPRINTF _snprintf
--- 111,124 ----
  # define DIRECTIVE char_directive
  # define DIRECTIVES char_directives
  # define PRINTF_PARSE printf_parse
! # /* 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]