Skip to content

Commit

Permalink
Fix un-initialized variable tgmod (function rgroup_Grow)
Browse files Browse the repository at this point in the history
the variable `tgmod` was un-initialized/had outdated value if `s->temp_class == NoSeason`

- close #332
  • Loading branch information
dschlaep committed Jul 8, 2019
1 parent f9264f3 commit 18bfac0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ST_resgroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,7 @@ void rgroup_Grow(void) {
continue;

/* Modify growth rate by temperature calculated in Env_Generate() */
if (s->tempclass != NoSeason)
tgmod = Env.temp_reduction[s->tempclass];
tgmod = (s->tempclass == NoSeason) ? 1. : Env.temp_reduction[s->tempclass];

/* Now increase size of the individual plants of current species */
ForEachIndiv(ndv, s) {
Expand Down

0 comments on commit 18bfac0

Please sign in to comment.