temp = (char *)priv->host->service->about->version;
/* Expecting 'major.minor.release' format */
- if (virStrToLong_ui(temp, &temp, 10, &major) < 0 || temp == NULL ||
- *temp != '.') {
+ if (virStrToLong_ui(temp, &temp, 10, &major) < 0 || *temp != '.') {
goto failure;
}
- if (virStrToLong_ui(temp + 1, &temp, 10, &minor) < 0 || temp == NULL ||
- *temp != '.') {
+ if (virStrToLong_ui(temp + 1, &temp, 10, &minor) < 0 || *temp != '.') {
goto failure;
}
}
start = val + strlen("host=");
- if (virStrToLong_i(start, &end, 16, &bus) < 0 || !end || *end != ':') {
+ if (virStrToLong_i(start, &end, 16, &bus) < 0 || *end != ':') {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot extract PCI device bus '%s'"), val);
VIR_FREE(def);
goto cleanup;
}
start = end + 1;
- if (virStrToLong_i(start, &end, 16, &slot) < 0 || !end || *end != '.') {
+ if (virStrToLong_i(start, &end, 16, &slot) < 0 || *end != '.') {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot extract PCI device slot '%s'"), val);
VIR_FREE(def);
start = val + strlen("host:");
if (strchr(start, ':')) {
- if (virStrToLong_i(start, &end, 16, &first) < 0 || !end || *end != ':') {
+ if (virStrToLong_i(start, &end, 16, &first) < 0 || *end != ':') {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot extract USB device vendor '%s'"), val);
VIR_FREE(def);
goto cleanup;
}
} else {
- if (virStrToLong_i(start, &end, 10, &first) < 0 || !end || *end != '.') {
+ if (virStrToLong_i(start, &end, 10, &first) < 0 || *end != '.') {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot extract USB device bus '%s'"), val);
VIR_FREE(def);
for (i = 0; i < nkws; i++) {
if (vals[i] == NULL) {
if (i > 0 ||
- virStrToLong_i(kws[i], &end, 10, &n) < 0 ||
- !end || *end != '\0')
+ virStrToLong_i(kws[i], &end, 10, &n) < 0 || *end != '\0')
goto syntax;
dom->vcpus = n;
} else {
- if (virStrToLong_i(vals[i], &end, 10, &n) < 0 ||
- !end || *end != '\0')
+ if (virStrToLong_i(vals[i], &end, 10, &n) < 0 || *end != '\0')
goto syntax;
if (STREQ(kws[i], "sockets"))
sockets = n;
goto done;
tmp += strlen(MIGRATION_TRANSFER_PREFIX);
- if (virStrToLong_ull(tmp, &end, 10, transferred) < 0 || !end) {
+ if (virStrToLong_ull(tmp, &end, 10, transferred) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse migration data transferred statistic %s"), tmp);
goto cleanup;
goto done;
tmp += strlen(MIGRATION_REMAINING_PREFIX);
- if (virStrToLong_ull(tmp, &end, 10, remaining) < 0 || !end) {
+ if (virStrToLong_ull(tmp, &end, 10, remaining) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse migration data remaining statistic %s"), tmp);
goto cleanup;
goto done;
tmp += strlen(MIGRATION_TOTAL_PREFIX);
- if (virStrToLong_ull(tmp, &end, 10, total) < 0 || !end) {
+ if (virStrToLong_ull(tmp, &end, 10, total) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse migration data total statistic %s"), tmp);
goto cleanup;