replaced the unsafe tag2str implementation by a safe one, now that it seems to be meant for general use ;)

svn-id: r30599
This commit is contained in:
Max Horn 2008-01-21 13:01:32 +00:00
parent 86456702f9
commit daf2bc9579
2 changed files with 5 additions and 4 deletions

View File

@ -640,12 +640,12 @@ char *scumm_strrev(char *str) {
return str;
}
const char *tag2str(uint32 tag) {
static char str[5];
Common::String tag2string(uint32 tag) {
char str[5];
str[0] = (char)(tag >> 24);
str[1] = (char)(tag >> 16);
str[2] = (char)(tag >> 8);
str[3] = (char)tag;
str[4] = '\0';
return str;
return Common::String(str);
}

View File

@ -319,7 +319,8 @@ extern int gDebugLevel;
char *scumm_strrev(char *str);
const char *tag2str(uint32 tag);
Common::String tag2string(uint32 tag);
#define tag2str(x) tag2string(x).c_str()
#endif