1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00
2003-04-14  Ulrich Drepper  <drepper@redhat.com>

	* string/strxfrm.c (STRXFRM): Terminate rulearr at correct
	position.  Reported by jreiser@BitWagon.com.
This commit is contained in:
Ulrich Drepper
2003-04-14 07:03:40 +00:00
parent 4ae7142df2
commit 39a46c42f5
7 changed files with 284 additions and 226 deletions

View File

@@ -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 <drepper@cygnus.com>, 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;