Skip to content

Commit

Permalink
Fix coverity 1026714. Modulo by zero. In fact an operator precedence …
Browse files Browse the repository at this point in the history
…error, fixed by applying brackets in the correct place.
  • Loading branch information
stuartm committed Jun 9, 2013
1 parent 0d35810 commit 4f8c8d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythfreemheg/Programs.cpp
Expand Up @@ -384,7 +384,7 @@ void MHResidentProgram::CallProgram(bool fIsFork, const MHObjectRef &success, co
{
int nLimit = GetInt(args.GetAt(0), engine);
MHParameter *pResInt = args.GetAt(1);
int r = random() % nLimit + 1;
int r = random() % (nLimit + 1);
engine->FindObject(
*(pResInt->GetReference()))->SetVariableValue(r);
SetSuccessFlag(success, true, engine);
Expand Down

0 comments on commit 4f8c8d9

Please sign in to comment.