From 39a46c42f5d31566573fceb6691a547c3b3b1e74 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 14 Apr 2003 07:03:40 +0000 Subject: Update. 2003-04-14 Ulrich Drepper * string/strxfrm.c (STRXFRM): Terminate rulearr at correct position. Reported by jreiser@BitWagon.com. --- string/strxfrm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'string/strxfrm.c') diff --git a/string/strxfrm.c b/string/strxfrm.c index 6475fa9206..9db57829d9 100644 --- a/string/strxfrm.c +++ b/string/strxfrm.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1999,2000,2001,2002 Free Software Foundation, Inc. +/* Copyright (C) 1995-1999,2000,2001,2002,2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Ulrich Drepper , 1995. @@ -196,9 +196,6 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l) idxarr = (int32_t *) alloca (srclen * sizeof (int32_t)); rulearr = (unsigned char *) alloca (srclen + 1); } - /* This element is only read, the value never used but to determine - another value which then is ignored. */ - rulearr[srclen] = '\0'; idxmax = 0; do @@ -211,6 +208,10 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l) } while (*usrc != L('\0')); + /* This element is only read, the value never used but to determine + another value which then is ignored. */ + rulearr[idxmax] = '\0'; + /* Now the passes over the weights. We now use the indeces we found before. */ needed = 0; -- cgit v1.2.3