Fixed endian bug in the decoding of strings

svn-id: r29674
This commit is contained in:
Paul Gilbert 2007-11-30 23:58:29 +00:00
parent 98545ad4e5
commit 5cf2a45b77

View file

@ -228,11 +228,11 @@ void StringData::getString(uint16 stringId, char *dest, const char *hotspotName,
// Returns the name or fragment of word at the specified index in the names resource
char *StringData::getName(uint8 nameIndex) {
uint16 numNames = *((uint16 *) _names->data()) / 2;
uint16 numNames = READ_LE_UINT16(_names->data()) / 2;
if (nameIndex >= numNames)
error("Invalid name index was passed to getCharacterName");
uint16 nameStart = *((uint16 *) (_names->data() + (nameIndex * 2)));
uint16 nameStart = READ_LE_UINT16(_names->data() + (nameIndex * 2));
return (char *) (_names->data() + nameStart);
}