Skip to content

Commit 37250ff

Browse files
committed
Use strncpy in some calls for alsa_rawmidi.c
Signed-off-by: falkTX <[email protected]>
1 parent f0400a4 commit 37250ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

linux/alsa/alsa_rawmidi.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ void midi_port_init(const alsa_rawmidi_t *midi, midi_port_t *port, snd_rawmidi_i
411411

412412
port->id = *id;
413413
snprintf(port->dev, sizeof(port->dev), "hw:%d,%d,%d", id->id[0], id->id[1], id->id[3]);
414-
snprintf(port->device_name, sizeof(port->device_name), snd_rawmidi_info_get_name(info));
414+
strncpy(port->device_name, snd_rawmidi_info_get_name(info), sizeof(port->device_name));
415415
name = snd_rawmidi_info_get_subdevice_name(info);
416416
if (!strlen(name))
417417
name = port->device_name;
@@ -468,7 +468,7 @@ int midi_port_open(alsa_rawmidi_t *midi, midi_port_t *port)
468468

469469
/* Some devices (emu10k1) have subdevs with the same name,
470470
* and we need to generate unique port name for jack */
471-
snprintf(name, sizeof(name), "%s", port->name);
471+
strncpy(name, port->name, sizeof(name));
472472
if (midi_port_open_jack(midi, port, type, name)) {
473473
int num;
474474
num = port->id.id[3] ? port->id.id[3] : port->id.id[1];

0 commit comments

Comments
 (0)