validate-utils: sqrt(-1.0) leads to undefined result

Using sqrt of -1 is not valid and leads to undefined results.
When comparing the return value of the fucntion in validate-scenario,
it is being checked with ret == -1, so it makes sense to just return -1 in error case.

https://bugzilla.gnome.org/show_bug.cgi?id=748389
This commit is contained in:
Vineeth T M 2015-05-29 15:40:04 +01:00 committed by Luis de Bethencourt
parent e832785604
commit 1e3084aa95

View file

@ -322,10 +322,9 @@ _parse (MathParser * parser)
"Failed to reach end of input expression, likely malformed input"); "Failed to reach end of input expression, likely malformed input");
} else } else
return result; return result;
} else {
return sqrt (-1.0);
} }
return sqrt (-1.0);
return -1.0;
} }
static gdouble static gdouble