From: Christopher John Purnell Date: Mon, 20 May 2002 17:25:55 +0000 (+0000) Subject: My bad. X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=40ae798d4238bae52cb70f01894b47482a478cc8;p=freeglut My bad. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@26 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/freeglut-1.3/freeglut_font.c b/freeglut-1.3/freeglut_font.c index 90d38e3..1115b4e 100644 --- a/freeglut-1.3/freeglut_font.c +++ b/freeglut-1.3/freeglut_font.c @@ -137,7 +137,7 @@ void FGAPIENTRY glutBitmapCharacter( void* fontID, int character ) /* * Make sure the character we want to output is valid */ - freeglut_return_if_fail( character >= 0 && character < font->Quantity ); + freeglut_return_if_fail( character >= 0 && character < font->256 ); /* * Then find the character we want to draw @@ -196,7 +196,7 @@ int FGAPIENTRY glutBitmapWidth( void* fontID, int character ) /* * Make sure the character we want to output is valid */ - freeglut_return_val_if_fail( character > 0 && character < font->Quantity, 0 ); + freeglut_return_val_if_fail( character > 0 && character < font->256, 0 ); /* * Scan the font looking for the specified character @@ -225,6 +225,8 @@ void FGAPIENTRY glutStrokeCharacter( void* fontID, int character ) schar = font->Characters[character]; + freeglut_return_if_fail( schar ); + strip = schar->Strips; for (i = 0; i < schar->Number; i++, strip++) @@ -254,7 +256,11 @@ int FGAPIENTRY glutStrokeWidth( void* fontID, int character ) */ freeglut_return_if_fail( character >= 0 && character < font->Quantity ); - return (font->Characters[character]->Right); + schar = font->Characters[character]; + + freeglut_return_if_fail( schar ); + + return (schar->Right); } /*