Skip to content

Commit

Permalink
config: fix const configfile
Browse files Browse the repository at this point in the history
  • Loading branch information
columbarius committed Mar 1, 2021
1 parent 4a35ce4 commit e9a950b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ struct xdpw_config {

void print_config(enum LOGLEVEL loglevel, struct xdpw_config *config);
void finish_config(struct xdpw_config *config);
void init_config(const char **configfile, struct xdpw_config *config);
void init_config(char ** const configfile, struct xdpw_config *config);

#endif
2 changes: 1 addition & 1 deletion src/core/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static char *get_config_path(void) {
return NULL;
}

void init_config(const char **configfile, struct xdpw_config *config) {
void init_config(char ** const configfile, struct xdpw_config *config) {
if (*configfile == NULL) {
*configfile = get_config_path();
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int handle_name_lost(sd_bus_message *m, void *userdata, sd_bus_error *ret

int main(int argc, char *argv[]) {
struct xdpw_config config = {0};
const char *configfile = NULL;
char *configfile = NULL;
enum LOGLEVEL loglevel = DEFAULT_LOGLEVEL;
bool replace = false;

Expand Down Expand Up @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) {

// TODO: cleanup
finish_config(&config);
free((char *)configfile);
free(configfile);

return EXIT_SUCCESS;

Expand Down

0 comments on commit e9a950b

Please sign in to comment.