On 19/07/2015 01:52, Carlos L. Torres wrote: > + int err; > > info->qemu = g_new0(VersionTriple, 1); > - info->qemu->major = strtol(version, &tmp, 10); > + err = qemu_strtol(version, &tmp, 10, &(info->qemu->major));
There are usually no parentheses around the argument of the & operator. > + if (err) { > + error_setg(errp, "There was a problem retrieving QEMU major > version."); > + } I think it's okay to just assert that err is zero. Otherwise, this simple example is okay. Thanks! Paolo > tmp++; > - info->qemu->minor = strtol(tmp, &tmp, 10); > + > + err = qemu_strtol(tmp, &tmp, 10, &(info->qemu->minor)); > + if (err) { > + error_setg(errp, "There was a problem retrieving QEMU minor > version."); > + } > tmp++; > - info->qemu->micro = strtol(tmp, &tmp, 10); > + > + err = qemu_strtol(tmp, &tmp, 10, &(info->qemu->micro)); > + if (err) { > + error_setg(errp, "There was a problem retrieving QEMU micro > version."); > + }