mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-24 06:05:56 -05:00
fix errors when using a null default in conf_get_string
This commit is contained in:
parent
d3fc9de354
commit
e5dd11b090
@ -395,6 +395,11 @@ int conf_get_string(char *section, char *key, char *dflt, char *out, int *size)
|
||||
result = pitem->value.as_string;
|
||||
}
|
||||
|
||||
if(!result) {
|
||||
_conf_unlock();
|
||||
return CONF_E_NOTFOUND;
|
||||
}
|
||||
|
||||
len = (int) strlen(result) + 1;
|
||||
|
||||
if(len <= *size) {
|
||||
|
@ -29,6 +29,7 @@
|
||||
#define CONF_E_PARSE 4
|
||||
#define CONF_E_OVERFLOW 5 /** <Buffer passed too small */
|
||||
#define CONF_E_NOCONF 6 /** <No open config file */
|
||||
#define CONF_E_NOTFOUND 7
|
||||
|
||||
|
||||
extern int conf_read(char *file);
|
||||
|
@ -266,7 +266,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
if(!foreground) {
|
||||
size = PATH_MAX;
|
||||
if(conf_get_string("general","logfile",NULL,logfile,&size)) {
|
||||
if(conf_get_string("general","logfile",NULL,logfile,&size) == CONF_E_SUCCESS) {
|
||||
err_setdest(logfile,LOGDEST_LOGFILE);
|
||||
} else {
|
||||
err_setdest("mt-daapd",LOGDEST_SYSLOG);
|
||||
|
Loading…
Reference in New Issue
Block a user