- int c, length = 0, this_line_length = 0;
- SFG_Font* font = fghFontByID( fontID );
- int numchar = strlen( string );
-
- for( c = 0; c < numchar; c++ )
+ unsigned char c;
+ int length = 0, this_line_length = 0;
+ SFG_Font* font;
+ FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutBitmapLength" );
+ font = fghFontByID( fontID );
+ freeglut_return_val_if_fail( font, 0 );
+ if ( !string || ! *string )
+ return 0;
+
+ while( ( c = *string++) )