diff --git a/epicardium/meson.build b/epicardium/meson.build index cf67023b9f7143336875d973108d8ee0a080ffd1..a6a6c05261c16ced283c4d8591b335237f6acd37 100644 --- a/epicardium/meson.build +++ b/epicardium/meson.build @@ -70,7 +70,7 @@ subdir('ble/') subdir('l0der/') -epicardium_cargs = [] +epicardium_cargs = ['-D_POSIX_C_SOURCE=200809'] if get_option('jailbreak_card10') epicardium_cargs += [ '-DJAILBREAK_CARD10=1', diff --git a/epicardium/modules/config.c b/epicardium/modules/config.c index 2c41f814eeaef4410315aba930c47f74db16533b..47396e2195b8b262f41279dbdad4e588430efdef 100644 --- a/epicardium/modules/config.c +++ b/epicardium/modules/config.c @@ -125,10 +125,7 @@ const char *elide(const char *str) static bool set_string(struct config_option *opt, const char *value) { //this leaks, but the lifetime of these ends when epicardium exits, so... - size_t len = strlen(value); - char *leaks = (char *)malloc(len + 1); - strncpy(leaks, value, len); - leaks[len] = '\0'; + char *leaks = strdup(value); opt->value.string = leaks; LOG_DEBUG("card10.cfg", "setting '%s' to %s", opt->name, elide(leaks)); return true;