Skip to content

Commit 3527125

Browse files
committed
minor - guard divide by zero
1 parent a0c3296 commit 3527125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

interface/ceed-operator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ int CeedOperatorGetFlopsEstimate(CeedOperator op, CeedSize *flops) {
17381738
CeedCall(CeedElemRestrictionGetNumPointsInElement(rstr_points, i, &points_in_elem));
17391739
num_points += points_in_elem;
17401740
}
1741-
num_points = num_points / num_elem + (num_points % num_elem > 0);
1741+
num_points = num_elem == 0 ? 0 : (num_points / num_elem + (num_points % num_elem > 0));
17421742
}
17431743
CeedCall(CeedElemRestrictionDestroy(&rstr_points));
17441744
}

0 commit comments

Comments
 (0)