BIF_GetStringWidth() returned garbage when given a 0 length string, which was causing

This commit is contained in:
Matt Ebb 2006-07-31 10:49:35 +00:00
parent 876885df45
commit 7bd41a99e0
1 changed files with 2 additions and 0 deletions

View File

@ -385,6 +385,8 @@ float FTF_TTFont::GetStringWidth(char* str, unsigned int flag)
wchar_t wstr[FTF_MAX_STR_SIZE-1]={'\0'};
int len=0;
if (strlen(str)==0) return 0.0;
/* note; this utf8towchar() function I totally don't understand... without using translations it
removes special characters completely. So, for now we just skip that then. (ton) */