projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chown: work around OpenBSD bug
[gnulib.git]
/
lib
/
vasnprintf.c
diff --git
a/lib/vasnprintf.c
b/lib/vasnprintf.c
index
a5b07d9
..
ab66288
100644
(file)
--- a/
lib/vasnprintf.c
+++ b/
lib/vasnprintf.c
@@
-257,7
+257,7
@@
local_wcsnlen (const wchar_t *s, size_t maxlen)
# ifndef decimal_point_char_defined
# define decimal_point_char_defined 1
static char
# ifndef decimal_point_char_defined
# define decimal_point_char_defined 1
static char
-decimal_point_char ()
+decimal_point_char (
void
)
{
const char *point;
/* Determine it in a multithread-safe way. We know nl_langinfo is
{
const char *point;
/* Determine it in a multithread-safe way. We know nl_langinfo is
@@
-2375,16
+2375,16
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
while (precision > 0)
{
characters = 0;
while (precision > 0)
{
- char buf[64]; /* Assume MB_CUR_MAX <= 64. */
+ char
c
buf[64]; /* Assume MB_CUR_MAX <= 64. */
int count;
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
# if HAVE_WCRTOMB
int count;
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
# if HAVE_WCRTOMB
- count = wcrtomb (buf, *arg_end, &state);
+ count = wcrtomb (
c
buf, *arg_end, &state);
# else
# else
- count = wctomb (buf, *arg_end);
+ count = wctomb (
c
buf, *arg_end);
# endif
if (count < 0)
{
# endif
if (count < 0)
{
@@
-2420,16
+2420,16
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0;
for (;;)
{
characters = 0;
for (;;)
{
- char buf[64]; /* Assume MB_CUR_MAX <= 64. */
+ char
c
buf[64]; /* Assume MB_CUR_MAX <= 64. */
int count;
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
# if HAVE_WCRTOMB
int count;
if (*arg_end == 0)
/* Found the terminating null wide character. */
break;
# if HAVE_WCRTOMB
- count = wcrtomb (buf, *arg_end, &state);
+ count = wcrtomb (
c
buf, *arg_end, &state);
# else
# else
- count = wctomb (buf, *arg_end);
+ count = wctomb (
c
buf, *arg_end);
# endif
if (count < 0)
{
# endif
if (count < 0)
{
@@
-2470,20
+2470,20
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
for (remaining = characters; remaining > 0; )
{
# endif
for (remaining = characters; remaining > 0; )
{
- char buf[64]; /* Assume MB_CUR_MAX <= 64. */
+ char
c
buf[64]; /* Assume MB_CUR_MAX <= 64. */
int count;
if (*arg == 0)
abort ();
# if HAVE_WCRTOMB
int count;
if (*arg == 0)
abort ();
# if HAVE_WCRTOMB
- count = wcrtomb (buf, *arg, &state);
+ count = wcrtomb (
c
buf, *arg, &state);
# else
# else
- count = wctomb (buf, *arg);
+ count = wctomb (
c
buf, *arg);
# endif
if (count <= 0)
/* Inconsistency. */
abort ();
# endif
if (count <= 0)
/* Inconsistency. */
abort ();
- memcpy (tmpptr, buf, count);
+ memcpy (tmpptr,
c
buf, count);
tmpptr += count;
arg++;
remaining -= count;
tmpptr += count;
arg++;
remaining -= count;
@@
-2552,20
+2552,20
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
ENSURE_ALLOCATION (xsum (length, characters));
for (remaining = characters; remaining > 0; )
{
ENSURE_ALLOCATION (xsum (length, characters));
for (remaining = characters; remaining > 0; )
{
- char buf[64]; /* Assume MB_CUR_MAX <= 64. */
+ char
c
buf[64]; /* Assume MB_CUR_MAX <= 64. */
int count;
if (*arg == 0)
abort ();
# if HAVE_WCRTOMB
int count;
if (*arg == 0)
abort ();
# if HAVE_WCRTOMB
- count = wcrtomb (buf, *arg, &state);
+ count = wcrtomb (
c
buf, *arg, &state);
# else
# else
- count = wctomb (buf, *arg);
+ count = wctomb (
c
buf, *arg);
# endif
if (count <= 0)
/* Inconsistency. */
abort ();
# endif
if (count <= 0)
/* Inconsistency. */
abort ();
- memcpy (result + length, buf, count);
+ memcpy (result + length,
c
buf, count);
length += count;
arg++;
remaining -= count;
length += count;
arg++;
remaining -= count;
@@
-2581,21
+2581,21
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
while (arg < arg_end)
{
# endif
while (arg < arg_end)
{
- char buf[64]; /* Assume MB_CUR_MAX <= 64. */
+ char
c
buf[64]; /* Assume MB_CUR_MAX <= 64. */
int count;
if (*arg == 0)
abort ();
# if HAVE_WCRTOMB
int count;
if (*arg == 0)
abort ();
# if HAVE_WCRTOMB
- count = wcrtomb (buf, *arg, &state);
+ count = wcrtomb (
c
buf, *arg, &state);
# else
# else
- count = wctomb (buf, *arg);
+ count = wctomb (
c
buf, *arg);
# endif
if (count <= 0)
/* Inconsistency. */
abort ();
ENSURE_ALLOCATION (xsum (length, count));
# endif
if (count <= 0)
/* Inconsistency. */
abort ();
ENSURE_ALLOCATION (xsum (length, count));
- memcpy (result + length, buf, count);
+ memcpy (result + length,
c
buf, count);
length += count;
arg++;
}
length += count;
arg++;
}
@@
-5476,6
+5476,7
@@
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#undef TCHARS_PER_DCHAR
#undef SNPRINTF
#undef USE_SNPRINTF
#undef TCHARS_PER_DCHAR
#undef SNPRINTF
#undef USE_SNPRINTF
+#undef DCHAR_SET
#undef DCHAR_CPY
#undef PRINTF_PARSE
#undef DIRECTIVES
#undef DCHAR_CPY
#undef PRINTF_PARSE
#undef DIRECTIVES