This commit is contained in:
Bertrand Songis
2015-09-14 06:40:35 +02:00
parent c269b2ceff
commit 3387395932
+6 -4
View File
@@ -336,12 +336,14 @@ void getLogicalSwitchAudioFile(char * filename, int index, unsigned int event)
#if defined(PCBTARANIS)
*str++ = 'L';
if (index >= 10) {
div_t qr = div(index, 10);
if (index >= 9) {
div_t qr = div(index+1, 10);
*str++ = '1' + qr.quot;
index = qr.rem;
*str++ = '0' + qr.rem;
}
else {
*str++ = '1' + index;
}
*str++ = '1' + index;
#else
int len = STR_VSWITCHES[0];
strncpy(str, &STR_VSWITCHES[1+len*(index+SWSRC_FIRST_LOGICAL_SWITCH)], len);