Skip to content
Snippets Groups Projects
Commit 1e3084aa authored by Vineeth T M's avatar Vineeth T M Committed by Luis de Bethencourt
Browse files

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
parent e8327856
No related branches found
No related tags found
No related merge requests found
...@@ -322,10 +322,9 @@ _parse (MathParser * parser) ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment