Browse Source

Check port name before opening it

Before letting the open function of a MIDI backend trying to open
the port, perform a basic check on the port name, and avoid calling
the backend on a port which is obviously not recognizable by that
backend.
develop
Damien Goutte-Gattat 8 years ago
parent
commit
373ce5d308
  1. 4
      src/midi.c

4
src/midi.c

@ -291,11 +291,11 @@ midi_open(const char *name)
midi = NULL;
#ifdef HAVE_ALSA
if ( midi == NULL )
if ( midi == NULL && strncmp("hw:", name, 3) == 0 )
midi = alsa_midi_open(name);
#endif
#ifdef HAVE_OSS
if ( midi == NULL )
if ( midi == NULL && strncmp("/dev/midi", name, 9) == 0 )
midi = oss_midi_open(name);
#endif

Loading…
Cancel
Save