1
0
Fork 0

Rewrote a slightly ambiguous code fragment (contributed by Charlie Hotchkiss)

This commit is contained in:
curt 1998-06-01 17:49:44 +00:00
parent 15790ef4b4
commit a8deedaa66

View file

@ -157,16 +157,25 @@ fgDebugClass fgDebugStrToClass( char *str ) {
} }
/* Check for 0xXXXXXX notation */ /* Check for 0xXXXXXX notation */
if( (p = strstr( str, "0x")) ) { p = strstr( str, "0x");
if( p ) {
p++; p++; p++; p++;
while (*p) { while (*p) {
if( (ph = strchr(hex,*p)) || (ph = strchr(hexl,*p)) ){ ph = strchr(hex,*p);
val <<= 4; if ( ph ) {
val <<= 4;
val += ph-hex; val += ph-hex;
p++; p++;
} else { } else {
// fprintf( stderr, "Error in hex string '%s'\n", str ); ph = strchr(hexl,*p);
return FG_NONE; if ( ph ) {
val <<= 4;
val += ph-hex;
p++;
} else {
// fprintf( stderr, "Error in hex string '%s'\n", str );
return FG_NONE;
}
} }
} }
} else { } else {
@ -273,9 +282,12 @@ int fgPrintf( fgDebugClass dbg_class, fgDebugPriority prio, char *fmt, ... ) {
/* $Log$ /* $Log$
/* Revision 1.3 1998/05/07 23:03:54 curt /* Revision 1.4 1998/06/01 17:49:44 curt
/* Added an entry for AUTOPILOT. /* Rewrote a slightly ambiguous code fragment (contributed by Charlie Hotchkiss)
/* /*
* Revision 1.3 1998/05/07 23:03:54 curt
* Added an entry for AUTOPILOT.
*
* Revision 1.2 1998/04/21 17:03:45 curt * Revision 1.2 1998/04/21 17:03:45 curt
* Prepairing for C++ integration. * Prepairing for C++ integration.
* *