commit a9dd7b48b804b0a3ce88f0109cd96b59a413d1bd
parent 0f931c9062c154a318646f636e497203b761ca9e
Author: Andreas Gruhler <agruhl@gmx.ch>
Date: Fri, 23 Jul 2021 00:04:18 +0200
alloc slash and '\0' in config_file_path
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/diary.c b/src/diary.c
@@ -303,7 +303,7 @@ int main(int argc, char** argv) {
config_home = getenv("XDG_CONFIG_HOME");
if (config_home == NULL) config_home = XDG_CONFIG_HOME_FALLBACK;
// concat config home with the file path to the config file
- config_file_path = (char *) calloc(strlen(config_home) + strlen(CONFIG_FILE_PATH) + 1, sizeof(char));
+ config_file_path = (char *) calloc(strlen(config_home) + strlen(CONFIG_FILE_PATH) + 2, sizeof(char));
sprintf(config_file_path, "%s/%s", config_home, CONFIG_FILE_PATH);
// read config from config file path
read_config(config_file_path);