From 52a33795d32136a2cf835feab8c282c25f6a8f72 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 10 Nov 2006 15:20:59 +0000 Subject: * 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. --- string/strxfrm_l.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string/strxfrm_l.c') 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'); } -- cgit 1.4.1