Merge branch 'fix_path_construction_issue'

This commit is contained in:
Pierre-Louis Bonicoli 2018-03-22 02:37:10 +01:00
commit 948b41ef7a
Signed by: pilou
GPG Key ID: ADC2651DDACD3538
1 changed files with 2 additions and 1 deletions

View File

@ -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;