1
0
Fork 0

Maintenance: kr_87

overflow prevention
This commit is contained in:
Scott Giese 2021-02-21 10:15:15 -06:00
parent 6e64bd12e0
commit 8567209ada

View file

@ -402,9 +402,10 @@ void FGKR_87::update( double dt_sec ) {
if ( big > 99 ) { if ( big > 99 ) {
big = 99; big = 99;
} }
char formatted_timer[128];
char formatted_timer[24];
// cout << big << ":" << little << endl; // cout << big << ":" << little << endl;
snprintf(formatted_timer, 6, "%02d:%02d", big, little); snprintf(formatted_timer, 24, "%02d:%02d", big, little);
fgSetString( "/instrumentation/kr-87/outputs/timer-string", fgSetString( "/instrumentation/kr-87/outputs/timer-string",
formatted_timer ); formatted_timer );