$NetBSD: patch-ah,v 1.2 2004/02/18 05:07:34 ben Exp $ --- src/Fl_Text_Buffer.cxx.orig 2003-05-28 09:09:12.000000000 -0700 +++ src/Fl_Text_Buffer.cxx @@ -935,7 +935,8 @@ int Fl_Text_Buffer::expand_character( ch /* Convert control codes to readable character sequences */ /*... is this safe with international character sets? */ if ( ( ( unsigned char ) c ) <= 31 ) { - sprintf( outStr, "<%s>", ControlCodeTable[ c ] ); + i = c; + sprintf( outStr, "<%s>", ControlCodeTable[ i ] ); return strlen( outStr ); } else if ( c == 127 ) { sprintf( outStr, "" ); @@ -958,12 +959,14 @@ int Fl_Text_Buffer::expand_character( ch ** to ignore). */ int Fl_Text_Buffer::character_width( char c, int indent, int tabDist, char nullSubsChar ) { + int i; /* Note, this code must parallel that in Fl_Text_Buffer::ExpandCharacter */ if ( c == '\t' ) return tabDist - ( indent % tabDist ); - else if ( ( ( unsigned char ) c ) <= 31 ) - return strlen( ControlCodeTable[ c ] ) + 2; - else if ( c == 127 ) + else if ( ( ( unsigned char ) c ) <= 31 ) { + i = c; + return strlen( ControlCodeTable[ i ] ) + 2; + } else if ( c == 127 ) return 5; else if ( c == nullSubsChar ) return 5;