smell: potential div-by-0

This commit is contained in:
Scott Giese 2020-11-23 16:14:37 -06:00
parent 59e62b1414
commit 112c9a110b

View File

@ -777,7 +777,8 @@ bool SGMetar::scanVisibility()
return false; return false;
if (!scanNumber(&m, &denom, 1, 2)) if (!scanNumber(&m, &denom, 1, 2))
return false; return false;
distance += (double)i / denom; if (denom != 0)
distance += (double)i / denom;
} }
if (!strncmp(m, "SM", 2)) if (!strncmp(m, "SM", 2))