fix segfault on wordwrapping a string with a character >=128

This commit is contained in:
mniip 2013-09-06 15:04:49 +04:00 committed by jacksonmj
parent d9089d13c4
commit 8d96f3f6b6
2 changed files with 2 additions and 2 deletions

View File

@ -586,7 +586,7 @@ int Graphics::textwidth(const char *s)
return x-1;
}
int Graphics::CharWidth(char c)
int Graphics::CharWidth(unsigned char c)
{
return font_data[font_ptrs[(int)c]];
}

View File

@ -203,7 +203,7 @@ public:
//Font/text metrics
static int CharIndexAtPosition(char *s, int positionX, int positionY);
static int PositionAtCharIndex(char *s, int charIndex, int & positionX, int & positionY);
static int CharWidth(char c);
static int CharWidth(unsigned char c);
static int textnwidth(char *s, int n);
static void textnpos(char *s, int n, int w, int *cx, int *cy);
static int textwidthx(char *s, int w);