debug.cc (_Error_formatter::_M_print_string): In order to print individual words from __string...

2004-08-07  Jonathan Wakely  <redi@gcc.gnu.org>
	    Paolo Carlini  <pcarlini@suse.de>

	* src/debug.cc (_Error_formatter::_M_print_string): In order
	to print individual words from __string, _M_format_word can't
	be called since may be just sprintf, thus ignoring completely
	__n: instead, use memmove and append '\0' by hand.

Co-Authored-By: Paolo Carlini <pcarlini@suse.de>

From-SVN: r85670
This commit is contained in:
Jonathan Wakely 2004-08-07 16:31:50 +01:00 committed by Paolo Carlini
parent 49864a8255
commit 8844a2f541
2 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2004-08-07 Jonathan Wakely <redi@gcc.gnu.org>
Paolo Carlini <pcarlini@suse.de>
* src/debug.cc (_Error_formatter::_M_print_string): In order
to print individual words from __string, _M_format_word can't
be called since may be just sprintf, thus ignoring completely
__n: instead, use memmove and append '\0' by hand.
2004-08-07 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/c_locale.h (__convert_from_v): Don't

View File

@ -569,12 +569,17 @@ namespace __gnu_debug
{
// [__start, __end) denotes the next word
__end = __start;
while (isalnum(*__end)) ++__end;
if (__start == __end) ++__end;
if (isspace(*__end)) ++__end;
while (isalnum(*__end))
++__end;
if (__start == __end)
++__end;
if (isspace(*__end))
++__end;
assert(__end - __start + 1< __bufsize);
_M_format_word(__buf, __end - __start + 1, "%s", __start);
const ptrdiff_t __len = __end - __start;
assert(__len < __bufsize);
memmove(__buf, __start, __len);
__buf[__len] = '\0';
_M_print_word(__buf);
__start = __end;