diff --git a/src/config.c b/src/config.c index 3c733243c..021b2a06e 100644 --- a/src/config.c +++ b/src/config.c @@ -174,12 +174,7 @@ char *configGetDir(void) void configPrepareNotifications(char *prefix) { - char *colpos; - snprintf(cfgDevice, sizeof(cfgDevice), prefix); - - if ((colpos = strchr(cfgDevice, ':')) != NULL) - *(colpos + 1) = '\0'; } void configInit(char *prefix) diff --git a/src/opl.c b/src/opl.c index 3075da544..ca684d9b2 100644 --- a/src/opl.c +++ b/src/opl.c @@ -1377,6 +1377,11 @@ int saveConfig(int types, int showUI) if (showUI) { if (lscret) { char *path = configGetDir(); + if (path != NULL) { + char *colpos = strchr(path, ':'); + if (colpos != NULL) + *(colpos + 1) = '\0'; + } snprintf(notification, sizeof(notification), _l(_STR_SETTINGS_SAVED), path);