Skip to content

Commit

Permalink
Fix if HOME environment variable is not set. Fixes #560
Browse files Browse the repository at this point in the history
  • Loading branch information
TomTheBear committed Oct 20, 2023
1 parent 1ed0753 commit f6aee6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/perfgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ perfgroup_getGroups(
bstring LONG = bformat("LONG");
bstring REQUIRE = bformat("REQUIRE_NOHT");
char* Home = getenv("HOME");
if (!Home) Home = "";

int read_long = 0;
if ((grouppath == NULL)||(architecture == NULL)||(groupnames == NULL)||(Home == NULL))
Expand Down Expand Up @@ -844,6 +845,7 @@ perfgroup_readGroup(
GroupFileSections sec = GROUP_NONE;
bstring REQUIRE = bformat("REQUIRE_NOHT");
char* Home = getenv("HOME");
if (!Home) Home = "";
if ((grouppath == NULL)||(architecture == NULL)||(groupname == NULL)||(ginfo == NULL)||(Home == NULL))
return -EINVAL;

Expand Down

0 comments on commit f6aee6c

Please sign in to comment.