mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 16:21:06 +00:00
* stdio-common/vfprintf.c (process_string_arg): Optimize
ridiculous precision in wide char code printing multi-byte string. Reported by Jim Meyering <jim@meyering.net>.
This commit is contained in:
parent
ffecd39b9c
commit
49a8eb75eb
@ -1,5 +1,9 @@
|
|||||||
2007-05-06 Ulrich Drepper <drepper@redhat.com>
|
2007-05-06 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* stdio-common/vfprintf.c (process_string_arg): Optimize
|
||||||
|
ridiculous precision in wide char code printing multi-byte string.
|
||||||
|
Reported by Jim Meyering <jim@meyering.net>.
|
||||||
|
|
||||||
[BZ #4131]
|
[BZ #4131]
|
||||||
* elf/dl-addr.c (_dl_addr): Compare address with actual segment
|
* elf/dl-addr.c (_dl_addr): Compare address with actual segment
|
||||||
boundaries to work around systems with overlapping binary loading.
|
boundaries to work around systems with overlapping binary loading.
|
||||||
|
@ -1026,10 +1026,11 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
|||||||
const char *mbs = (const char *) string; \
|
const char *mbs = (const char *) string; \
|
||||||
mbstate_t mbstate; \
|
mbstate_t mbstate; \
|
||||||
\
|
\
|
||||||
len = prec != -1 ? (size_t) prec : strlen (mbs); \
|
len = prec != -1 ? __strnlen (mbs, (size_t) prec) : strlen (mbs); \
|
||||||
\
|
\
|
||||||
/* Allocate dynamically an array which definitely is long \
|
/* Allocate dynamically an array which definitely is long \
|
||||||
enough for the wide character version. */ \
|
enough for the wide character version. Each byte in the \
|
||||||
|
multi-byte string can produce at most one wide character. */ \
|
||||||
if (__libc_use_alloca (len * sizeof (wchar_t))) \
|
if (__libc_use_alloca (len * sizeof (wchar_t))) \
|
||||||
string = (CHAR_T *) alloca (len * sizeof (wchar_t)); \
|
string = (CHAR_T *) alloca (len * sizeof (wchar_t)); \
|
||||||
else if ((string = (CHAR_T *) malloc (len * sizeof (wchar_t))) \
|
else if ((string = (CHAR_T *) malloc (len * sizeof (wchar_t))) \
|
||||||
|
Loading…
Reference in New Issue
Block a user