Commit c04b6ae501d24f84486969d362a6348160e02ff2

brlcad 2010-05-12T16:29:08

pull in change from bzflag downstream, partial r20590 by brlcad, try harder to make sure we don't get a <char> template instantiation. getting a negative character code on high ascii values that causes a crash in FTGlyphContainer::Advance().

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/FTFont/FTFont.cpp b/src/FTFont/FTFont.cpp
index 7f96a47..4a9c232 100644
--- a/src/FTFont/FTFont.cpp
+++ b/src/FTFont/FTFont.cpp
@@ -466,7 +466,8 @@ inline float FTFontImpl::AdvanceI(const T* string, const int len,
 float FTFontImpl::Advance(const char* string, const int len, FTPoint spacing)
 {
     /* The chars need to be unsigned because they are cast to int later */
-    return AdvanceI((const unsigned char *)string, len, spacing);
+    const unsigned char *ustring = (const unsigned char *)string;
+    return AdvanceI(ustring, len, spacing);
 }