virqemu: Reflect return type of virJSONValueArraySize()

The virJSONValueArraySize() function return ssize_t (with
possibly returning -1 if the passed json is not an array).
Storing the return value into size_t is possibly dangerous then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-08-03 08:32:44 +02:00
parent 041f35340b
commit 84b476e2bd

View File

@ -85,7 +85,7 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
virBufferPtr buf)
{
const virJSONValue *member;
size_t nelems = virJSONValueArraySize(array);
ssize_t nelems = virJSONValueArraySize(array);
char *prefix = NULL;
size_t i;
int ret = 0;