Compare commits

...

1 Commits

Author SHA1 Message Date
Pierre-Louis Bonicoli c2dd35633b
Fix path construction
Thanks to Renzokuken for pointing that !
2018-03-21 11:07:56 +01:00
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;