Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
AleksArt000 committed Dec 3, 2023
1 parent aaa9ba5 commit cc5eda5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
@@ -72,14 +72,14 @@ int readConfig(const char* configFilePath)
line[strlen(line) - 1] = 0;

char* key = strtok(line, "=");
char* value = strtok(NULL, "=");
char* value = strchr(line, '\0') + 1;
if (key == NULL || value == NULL) {
msg(ERROR, "Invalid config file");
fclose(file);
return 1;
}

dbg(3, "Key: %s Value: %s", key, value);
dbg(2, "Key: %s Value: %s", key, value);

// Set environment variables based on the key-value pairs in the config file
setenv(key, value, 1);

0 comments on commit cc5eda5

Please sign in to comment.