Commit 2a105220 authored by Philip Withnall's avatar Philip Withnall Committed by Philip Withnall
Browse files

forward: Restrict answer count to be positive

Require it to be a positive integer. This is technically an API break,
but any code which used a non-positive integer before would not have
worked anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=774631
parent 2c131450
......@@ -397,7 +397,7 @@ geocode_forward_search (GeocodeForward *forward,
/**
* geocode_forward_set_answer_count:
* @forward: a #GeocodeForward representing a query
* @count: the number of requested results
* @count: the number of requested results, which must be greater than zero
*
* Sets the number of requested results to @count.
**/
......@@ -408,6 +408,7 @@ geocode_forward_set_answer_count (GeocodeForward *forward,
GValue *count_value;
g_return_if_fail (GEOCODE_IS_FORWARD (forward));
g_return_if_fail (count > 0);
forward->priv->answer_count = count;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment