diff --git a/lib_debug/debug.c b/lib_debug/debug.c index 736f35d43d3b41ca29428063ff654f396e18e3e1..c6a5f8c5efa24502f2b76d2e4d33c4b937ec49eb 100644 --- a/lib_debug/debug.c +++ b/lib_debug/debug.c @@ -39,6 +39,7 @@ #include "options.h" #ifdef DEBUGGING #include "debug.h" +#include #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK #include @@ -771,8 +772,10 @@ char *fname( const int16_t id, const int16_t enc_dec ) { - char idd[5] = ".idX"; - idd[3] = (char) ( id + '0' ); + char idd[6]; + + assert( id < 100 ); + sprintf( idd, ".id%d", id ); strcpy( tmp_fname, dir ); strcat( tmp_fname, file );