diff --git a/src/filehelper.c b/src/filehelper.c index f6c4961..4faf748 100644 --- a/src/filehelper.c +++ b/src/filehelper.c @@ -221,8 +221,11 @@ int readSettingsFromJsonFile(char *settingsFileName, app_settings_t *settings, &rates_filename)) { assert(sizeof(settings->rates_filename) > (long unsigned int)json_object_get_string_len(rates_filename)); - memcpy(settings->rates_filename, json_object_get_string(rates_filename), - json_object_get_string_len(rates_filename) + 1); + + if (strlen(settings->rates_filename) == 0) + memcpy(settings->rates_filename, + json_object_get_string(rates_filename), + json_object_get_string_len(rates_filename) + 1); write_adv_log("settings->rates_filename: %s\n", settings->rates_filename); diff --git a/src/phoebe.c b/src/phoebe.c index b523293..e5aaa98 100644 --- a/src/phoebe.c +++ b/src/phoebe.c @@ -292,6 +292,9 @@ int main(int argc, char **argv) { signal(SIGTERM, handleSigint); signal(SIGHUP, handleSighup); + bzero(&app_settings, sizeof(app_settings_t)); + bzero(&system_settings, sizeof(tuning_params_t)); + // set default verbosity setting before cmdline parsing, so // that it can be used before if (handleCommandLineArguments(argc, argv) == RET_FAIL)