diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-11-10 15:20:59 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-11-10 15:20:59 +0000 |
commit | 52a33795d32136a2cf835feab8c282c25f6a8f72 (patch) | |
tree | cf464ef9f719775d8da9541eaa7ab4d47f24dc45 /string/strxfrm_l.c | |
parent | 29f34a5bc1a720c59f49948dcd2014b3c653be18 (diff) | |
download | glibc-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.c | 2 |
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'); } |