summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2019-05-10 04:40:16 +0000
committerratchov <ratchov@openbsd.org>2019-05-10 04:40:16 +0000
commit270515a63e3dac12f89835fdf8b033633ceaa53a (patch)
tree969d943285c73cd03f4d20442403acd2c4986afb
parentDon't try to send to device helper process if it's terminated. (diff)
downloadwireguard-openbsd-270515a63e3dac12f89835fdf8b033633ceaa53a.tar.xz
wireguard-openbsd-270515a63e3dac12f89835fdf8b033633ceaa53a.zip
Use the correct length for MIDI common messages.
-rw-r--r--usr.bin/sndiod/midi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/sndiod/midi.c b/usr.bin/sndiod/midi.c
index 2af5dd04757..e42487dfc32 100644
--- a/usr.bin/sndiod/midi.c
+++ b/usr.bin/sndiod/midi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midi.c,v 1.17 2019/03/28 11:18:56 ratchov Exp $ */
+/* $OpenBSD: midi.c,v 1.18 2019/05/10 04:40:16 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -308,7 +308,8 @@ midi_in(struct midi *iep, unsigned char *idata, int icount)
iep->idx = 0;
} else if (c >= 0xf0) {
iep->msg[0] = c;
- iep->len = common_len[c & 7];
+ iep->len = common_len[c >> 5];
+ log_puti(iep->len);
iep->st = c;
iep->idx = 1;
} else if (c >= 0x80) {