Skip to content

Commit

Permalink
Silence valgind warning about jump or move depending on uninitialised…
Browse files Browse the repository at this point in the history
… value
  • Loading branch information
maddyscientist committed May 4, 2016
1 parent 109bea9 commit e0aa5b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/tune.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace quda {
TuneKey key = entry->first;
TuneParam param = entry->second;

char tmp[7];
char tmp[7] = { };
strncpy(tmp, key.aux, 6);
bool is_policy = strcmp(tmp, "policy") == 0 ? true : false;
if (param.n_calls > 0 && !is_policy) total_time += param.n_calls * param.time;
Expand All @@ -145,8 +145,8 @@ namespace quda {
TuneKey key = q.top().first;
TuneParam param = q.top().second;

char tmp[7];
strncpy(tmp, key.aux,6);
char tmp[7] = { };
strncpy(tmp, key.aux, 6);
bool is_policy = strcmp(tmp, "policy") == 0 ? true : false;

// synchronous profile
Expand Down Expand Up @@ -405,7 +405,7 @@ namespace quda {
int n_policy = 0;
for (map::iterator entry = tunecache.begin(); entry != tunecache.end(); entry++) {
// if a policy entry, then we can ignore
char tmp[6];
char tmp[7] = { };
strncpy(tmp, entry->first.aux, 6);
TuneParam param = entry->second;
bool is_policy = strcmp(tmp, "policy") == 0 ? true : false;
Expand Down

0 comments on commit e0aa5b9

Please sign in to comment.