edbus: Let arguments_get fail if getting less args than passed
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Mon, 17 Dec 2012 18:24:31 +0000 (18:24 +0000)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Mon, 17 Dec 2012 18:24:31 +0000 (18:24 +0000)
commitb304d7eec31d185f8204b66fe5b091ac719dd387
tree4e11e9d89f72ee56a5d89c588eff45f43c681091
parent7167295f04a39ba426adcbb97113b98252d66051
edbus: Let arguments_get fail if getting less args than passed

If user passed a string with more elements, return EINA_FALSE on
edbus_message_arguments_get() so he knows not all elements are
initialized. Before this patch, we would notify user of its error if he
did something like:

i) edbus_message_arguments_get(msg, "uu", &a)
ii) edbus_message_arguments_get(msg, "uu", &a, &b)

And "msg" containing only 1 argument.

This also fixes the case in which user is getting the elements of an
array iterator and the array is empty. We were previously returning
EINA_TRUE, even if we were not filling the variable.

Last but not least, if the user was calling
edbus_message_iter_arguments_get() in an empty array, we would return
EINA_FALSE, even if we didn't actually get any element.

SVN revision: 81170
src/lib/edbus_message.c