Skip to content

Commit

Permalink
I love C ... 💩
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasGocht committed Jan 26, 2018
1 parent f7a1ed1 commit 9b8833f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion uncore_perf_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ char* env(const char* name)
{
int name_len = strlen(name);
int scorep_len = strlen("SCOREP_METRIC_");
char* scorep_name = malloc((name_len + scorep_len) * sizeof(char));
char* scorep_name = malloc((name_len + scorep_len + 1) * sizeof(char));
sprintf(scorep_name, "%s%s", "SCOREP_METRIC_", name);
char* ret = getenv(scorep_name);
if (ret == NULL)
Expand Down

1 comment on commit 9b8833f

@tilsche
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can always port it to C++ 😎

Please sign in to comment.