It's OK to ask for the name of an audio format id < 0, as id -1 is used for
"currently no audio file is open". So allow this case, and fix the upper bound
which was off by one while we're at it.
*/
const char *audio_format_name(int i)
{
- assert(i >= 0 && i < ARRAY_SIZE(afl));
- return afl[i].name;
+ //PARA_NOTICE_LOG("array size: %u¸ requested: %d\n", ARRAY_SIZE(afl), i);
+ assert(i < 0 || i < ARRAY_SIZE(afl) - 1);
+ return i >= 0? afl[i].name : "(none)";
}
/**