aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2020-09-21 00:45:06 +0300
committerWohlstand <admin@wohlnet.ru>2020-09-21 00:45:06 +0300
commitf95e5ff580b68b13ba308fd54e1c95d4197ad863 (patch)
tree63539cbf427912686565dab81b3aa820346967b5 /src
parent193ac787fed2beb43c89312e5f45e231d50c544d (diff)
parent9b51dd7d667e97338a92711543fc3e942faae52f (diff)
downloadlibADLMIDI-f95e5ff580b68b13ba308fd54e1c95d4197ad863.tar.gz
libADLMIDI-f95e5ff580b68b13ba308fd54e1c95d4197ad863.tar.bz2
libADLMIDI-f95e5ff580b68b13ba308fd54e1c95d4197ad863.zip
Merge branch 'master' of github.com:Wohlstand/libADLMIDI
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi_midiplay.cpp2
-rw-r--r--src/wopl/wopl_file.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 8d92933..56283f3 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1841,7 +1841,7 @@ void MIDIplay::describeChannels(char *str, char *attr, size_t size)
AdlChannel::const_users_iterator locnext(loc);
if(!loc.is_end()) ++locnext;
- if(loc.is_end()) // off
+ if(loc.is_end()) // off
{
str[index] = '-';
}
diff --git a/src/wopl/wopl_file.c b/src/wopl/wopl_file.c
index b712020..5c96e41 100644
--- a/src/wopl/wopl_file.c
+++ b/src/wopl/wopl_file.c
@@ -173,7 +173,8 @@ static void WOPL_parseInstrument(WOPLInstrument *ins, uint8_t *cursor, uint16_t
static void WOPL_writeInstrument(WOPLInstrument *ins, uint8_t *cursor, uint16_t version, uint8_t has_sounding_delays)
{
int l;
- strncpy((char*)cursor, ins->inst_name, 32);
+ memcpy((char*)cursor, ins->inst_name, 32);
+ cursor[32] = '\0';
fromSint16BE(ins->note_offset1, cursor + 32);
fromSint16BE(ins->note_offset2, cursor + 34);
cursor[36] = (uint8_t)ins->midi_velocity_offset;
@@ -278,7 +279,7 @@ WOPLFile *WOPL_LoadBankFromMem(void *mem, size_t length, int *error)
outFile->version = version;
outFile->opl_flags = head[4];
outFile->volume_model = head[5];
- }
+ }
bankslots_sizes[0] = count_melodic_banks;
bankslots[0] = outFile->banks_melodic;