projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a9c425f
)
vasnprintf: Avoid passing an 'rpl_mbstate_t *' to the system's wcrtomb.
author
Bruno Haible
<bruno@clisp.org>
Fri, 1 Jan 2010 01:59:04 +0000
(
02:59
+0100)
committer
Bruno Haible
<bruno@clisp.org>
Fri, 1 Jan 2010 01:59:04 +0000
(
02:59
+0100)
ChangeLog
patch
|
blob
|
history
lib/vasnprintf.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 1afabab27055cec6355ef453a8598c3c58e0c400..ac19febdaa610045dc9944ff3af8e06d435b1f6e 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,3
+1,9
@@
+2010-01-01 Bruno Haible <bruno@clisp.org>
+
+ vasnprintf: Avoid passing an 'rpl_mbstate_t *' to the system's wcrtomb.
+ * lib/vasnprintf.c (VASNPRINTF): If GNULIB_defined_mbstate_t is
+ defined, use wctomb instead of wcrtomb.
+
2010-01-01 Bruno Haible <bruno@clisp.org>
iconv: Reject native Solaris iconv.
2010-01-01 Bruno Haible <bruno@clisp.org>
iconv: Reject native Solaris iconv.
diff --git
a/lib/vasnprintf.c
b/lib/vasnprintf.c
index 4dda536fc3b1a1428dc131a2aa5173964dac5633..79854ed87835f5389e8a4cc47d95a55c5e498a60 100644
(file)
--- a/
lib/vasnprintf.c
+++ b/
lib/vasnprintf.c
@@
-1,5
+1,5
@@
/* vsprintf with automatic memory allocation.
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-20
09
Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-20
10
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-2367,7
+2367,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use only as many wide characters as needed to produce
at most PRECISION bytes, from the left. */
{
/* Use only as many wide characters as needed to produce
at most PRECISION bytes, from the left. */
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
@@
-2381,7
+2381,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
count = wcrtomb (cbuf, *arg_end, &state);
# else
count = wctomb (cbuf, *arg_end);
count = wcrtomb (cbuf, *arg_end, &state);
# else
count = wctomb (cbuf, *arg_end);
@@
-2412,7
+2412,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* Use the entire string, and count the number of
bytes. */
{
/* Use the entire string, and count the number of
bytes. */
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
@@
-2426,7
+2426,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
count = wcrtomb (cbuf, *arg_end, &state);
# else
count = wctomb (cbuf, *arg_end);
count = wcrtomb (cbuf, *arg_end, &state);
# else
count = wctomb (cbuf, *arg_end);
@@
-2464,7
+2464,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
TCHAR_T *tmpptr = tmpsrc;
size_t remaining;
{
TCHAR_T *tmpptr = tmpsrc;
size_t remaining;
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
@@
-2475,7
+2475,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg == 0)
abort ();
if (*arg == 0)
abort ();
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
count = wcrtomb (cbuf, *arg, &state);
# else
count = wctomb (cbuf, *arg);
count = wcrtomb (cbuf, *arg, &state);
# else
count = wctomb (cbuf, *arg);
@@
-2545,7
+2545,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
/* We know the number of bytes in advance. */
size_t remaining;
{
/* We know the number of bytes in advance. */
size_t remaining;
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
@@
-2557,7
+2557,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg == 0)
abort ();
if (*arg == 0)
abort ();
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
count = wcrtomb (cbuf, *arg, &state);
# else
count = wctomb (cbuf, *arg);
count = wcrtomb (cbuf, *arg, &state);
# else
count = wctomb (cbuf, *arg);
@@
-2575,7
+2575,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
else
{
}
else
{
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
mbstate_t state;
memset (&state, '\0', sizeof (mbstate_t));
# endif
@@
-2586,7
+2586,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (*arg == 0)
abort ();
if (*arg == 0)
abort ();
-# if HAVE_WCRTOMB
+# if HAVE_WCRTOMB
&& !defined GNULIB_defined_mbstate_t
count = wcrtomb (cbuf, *arg, &state);
# else
count = wctomb (cbuf, *arg);
count = wcrtomb (cbuf, *arg, &state);
# else
count = wctomb (cbuf, *arg);