mirror of
https://github.com/michaeldv/pit.git
synced 2025-12-10 08:25:34 +00:00
segfault fixed in pit_file_name
This commit is contained in:
5
src/db.c
5
src/db.c
@@ -24,7 +24,10 @@ static char *pit_file_name()
|
|||||||
|
|
||||||
if (!*file_name) {
|
if (!*file_name) {
|
||||||
char *penv = getenv("PITFILE");
|
char *penv = getenv("PITFILE");
|
||||||
strcpy(file_name, expand_path(penv ? penv : PITFILE, file_name));
|
char *expanded = expand_path(penv ? penv : PITFILE, file_name);
|
||||||
|
if (expanded != file_name) {
|
||||||
|
strcpy(file_name, expanded);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return file_name;
|
return file_name;
|
||||||
|
|||||||
Reference in New Issue
Block a user