Skip to content
Permalink
Browse files

Merge pull request #808 from monome/fix-engine-report

fix crash in engine report (strlen), report engines on startup
  • Loading branch information
tehn committed Apr 9, 2019
2 parents 6935f09 + 1bef768 commit 74148c1b2f154ce2f6089053d895a53c35e356f2
Showing with 6 additions and 3 deletions.
  1. +3 −0 lua/core/startup.lua
  2. +3 −3 matron/src/oracle.c
@@ -53,6 +53,9 @@ norns.startup_status.ok = function()
norns.state.resume()
-- turn on VU
_norns.poll_start_vu()
-- report engines
report_engines()

end

norns.startup_status.timeout = function()
@@ -362,15 +362,15 @@ void o_set_engine_name(int idx, const char *name) {
"refusing to allocate engine name %d; already exists",
idx);
} else {
len = strlen(name);
len = strlen(name) + 1; // include null terminator
engine_names[idx] = malloc(len);
if ( engine_names[idx] == NULL ) {
fprintf(stderr,
"failure to malloc for engine name %d : %s\n",
idx,
name);
} else {
strncpy(engine_names[idx], name, len + 1);
strncpy(engine_names[idx], name, len);
}
}
o_unlock_descriptors();
@@ -709,7 +709,7 @@ int handle_engine_report_start(const char *path,
void *user_data)
{
assert(argc > 0);
// arg 1: count of engines
// arg 1: count of engines
o_clear_engine_names();
o_set_num_desc(&num_engines, argv[0]->i);
return 0;

0 comments on commit 74148c1

Please sign in to comment.