Browse Source

Fix crash in midi_latency_test

`s` points to a constant string literal in the current code (which is in practice
just a pointer in some read-only memory). The next line `s[2] = c;` either
crashes or just gets completely removed by the compiler as it attempts to
write to read-only memory.
pull/860/head
Raphael Isemann 3 years ago
parent
commit
e9be269141
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      example-clients/midi_latency_test.c

+ 1
- 2
example-clients/midi_latency_test.c View File

@@ -652,8 +652,7 @@ main(int argc, char **argv)
break;
default:
{
char *s = "'- '";
s[2] = c;
signed char s[] = {'\'', '-', c, '\'', '\0'};
die(s, "invalid switch");
}
case -1:


Loading…
Cancel
Save