Don't use initialized memory. Patch by Sebastian Reitenbach

<sebastia@l00-bugdead-prods.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@26577 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-05-27 19:58:56 +00:00
parent 2b02c9fd5d
commit 6b0246aa65
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2008-05-27 Fred Kiefer <FredKiefer@gmx.de>
* Source/xlib/GSXftFontInfo.m (-coveredCharacterSet): Moved the
swapping into the loop, where the actual data is available.
Patch by Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>.
2008-05-25 Adam Fedor <fedor@gnu.org>
* configure.ac: Fail if libXext or libXt not found when building

View file

@ -325,7 +325,8 @@ Ones(unsigned int n)
FcChar32 ucs4;
FcChar32 map[FC_CHARSET_MAP_SIZE];
FcChar32 next;
BOOL swap = NSHostByteOrder() == NS_BigEndian;
if (!d)
return nil;
@ -342,15 +343,15 @@ Ones(unsigned int n)
// Round up to a suitable plane size
max = ((max + 8191) >> 13) << 13;
[d setLength: max];
// Do some byte swapping, if needed.
if (NSHostByteOrder() == NS_BigEndian)
{
map[i] = NSSwapInt(map[i]);
}
for (i = 0; i < FC_CHARSET_MAP_SIZE; i++)
if (map[i])
{
// Do some byte swapping, if needed.
if (swap)
{
map[i] = NSSwapInt(map[i]);
}
count += Ones(map[i]);
}