summary refs log tree commit diff
path: root/string/strxfrm_l.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-11-10 15:20:59 +0000
committerUlrich Drepper <drepper@redhat.com>2006-11-10 15:20:59 +0000
commit52a33795d32136a2cf835feab8c282c25f6a8f72 (patch)
treecf464ef9f719775d8da9541eaa7ab4d47f24dc45 /string/strxfrm_l.c
parent29f34a5bc1a720c59f49948dcd2014b3c653be18 (diff)
downloadglibc-52a33795d32136a2cf835feab8c282c25f6a8f72.tar.gz
glibc-52a33795d32136a2cf835feab8c282c25f6a8f72.tar.xz
glibc-52a33795d32136a2cf835feab8c282c25f6a8f72.zip
* string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization
	if N is one bigger than return value.
	* string/tst-strxfrm2.c (do_test): Also test strxfrm with l1 + 1
	and l1 last arguments, if buf is defined, verify the return value
	equals to strlen (buf) and verify no byte beyond passed length
	is modified.
Diffstat (limited to 'string/strxfrm_l.c')
-rw-r--r--string/strxfrm_l.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c
index f158833f05..20f2f149bd 100644
--- a/string/strxfrm_l.c
+++ b/string/strxfrm_l.c
@@ -432,7 +432,7 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
   if (needed > 2 && needed == last_needed + 1)
     {
       /* Remove the \1 byte.  */
-      if (--needed < n)
+      if (--needed <= n)
 	dest[needed - 1] = L('\0');
     }