From c2dd35633b12c8ef498b5e42ddb8d8474e5b7067 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Wed, 21 Mar 2018 11:07:56 +0100 Subject: [PATCH] Fix path construction Thanks to Renzokuken for pointing that ! --- src/path_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/path_util.c b/src/path_util.c index ea3bba1..ebf3b30 100644 --- a/src/path_util.c +++ b/src/path_util.c @@ -18,10 +18,11 @@ char *default_path(const char *biphome, const char *filename, const char *desc) { char *conf_file; - // '/' and NULL + // '/' and \0 conf_file = bip_malloc(strlen(biphome) + strlen(filename) + 2); strcpy(conf_file, biphome); conf_file[strlen(biphome)] = '/'; + conf_file[strlen(biphome) + 1] = '\0'; strcat(conf_file, filename); mylog(LOG_INFO, "Using default %s: %s", desc, conf_file); return conf_file;