Fix persistence_location not appending a '/'.

pull/1964/head
Roger A. Light 5 years ago
parent 99e8c8001d
commit f930970008

@ -9,6 +9,7 @@ Broker:
Closes #1956.
- Fix local bridges being disconnected on SIGHUP. Closes #1942.
- Fix slow initial bridge connections for WITH_ADNS=no.
- Fix persistence_location not appending a '/'.
Clients:
- Fix mosquitto_sub being unable to terminate with Ctrl-C if a successful

@ -664,7 +664,11 @@ int config__read(struct mosquitto__config *config, bool reload)
len = strlen(config->persistence_location) + strlen(config->persistence_file) + 1;
config->persistence_filepath = mosquitto__malloc(len);
if(!config->persistence_filepath) return MOSQ_ERR_NOMEM;
snprintf(config->persistence_filepath, len, "%s%s", config->persistence_location, config->persistence_file);
#ifdef WIN32
snprintf(config->persistence_filepath, len, "%s\\%s", config->persistence_location, config->persistence_file);
#else
snprintf(config->persistence_filepath, len, "%s/%s", config->persistence_location, config->persistence_file);
#endif
}else{
config->persistence_filepath = mosquitto__strdup(config->persistence_file);
if(!config->persistence_filepath) return MOSQ_ERR_NOMEM;

Loading…
Cancel
Save