Fixes problem with dirname().
Thanks Henrique de Moraes Holschuh for the original patch.
This commit is contained in:
parent
af582c4811
commit
df27911880
1 changed files with 4 additions and 1 deletions
|
@ -170,7 +170,10 @@ cf_open(char *filename)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (*filename != '/') {
|
if (*filename != '/') {
|
||||||
snprintf(full_name, sizeof(full_name), "%s/%s", dirname(config_name), filename);
|
char dir[BIRD_FNAME_MAX];
|
||||||
|
strncpy(dir, config_name, sizeof(dir));
|
||||||
|
dir[sizeof(dir)-1] = 0;
|
||||||
|
snprintf(full_name, sizeof(full_name), "%s/%s", dirname(dir), filename);
|
||||||
full_name[sizeof(full_name)-1] = 0;
|
full_name[sizeof(full_name)-1] = 0;
|
||||||
cur = full_name;
|
cur = full_name;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue