return 0;
}
- if (VIR_STRNDUP(listenInfo->address, address,
- len == -1 ? strlen(address) : len) < 0)
+ if (VIR_STRNDUP(listenInfo->address, address, len) < 0)
return -1;
return 0;
}
return 0;
}
- if (VIR_STRNDUP(listenInfo->network, network,
- len == -1 ? strlen(network) : len) < 0)
+ if (VIR_STRNDUP(listenInfo->network, network, len) < 0)
return -1;
return 0;
}
if (!next)
next = strchr(curr, '\n');
- if (VIR_STRNDUP(arg, curr, next ? next - curr : strlen(curr)) < 0)
+ if (VIR_STRNDUP(arg, curr, next ? next - curr : -1) < 0)
goto error;
if (next && (*next == '\'' || *next == '"'))
if (VIR_STRNDUP(source->data.tcp.host, val, svc - val) < 0)
goto error;
svc++;
- if (VIR_STRNDUP(source->data.tcp.service, svc,
- opt ? opt - svc : strlen(svc)) < 0)
+ if (VIR_STRNDUP(source->data.tcp.service, svc, opt ? opt - svc : -1) < 0)
goto error;
} else if (STRPREFIX(val, "unix:")) {
const char *opt;
val += strlen("unix:");
opt = strchr(val, ',');
source->type = VIR_DOMAIN_CHR_TYPE_UNIX;
- if (VIR_STRNDUP(source->data.nix.path, val,
- opt ? opt - val : strlen(val)) < 0)
+ if (VIR_STRNDUP(source->data.nix.path, val, opt ? opt - val : -1) < 0)
goto error;
} else if (STRPREFIX(val, "/dev")) {
next++;
if (p == val) {
- if (VIR_STRNDUP(model, p, next ? next - p - 1 : strlen(p)) < 0)
+ if (VIR_STRNDUP(model, p, next ? next - p - 1 : -1) < 0)
goto error;
if (!STREQ(model, "qemu32") && !STREQ(model, "qemu64")) {
if (*p == '\0' || *p == ',')
goto syntax;
- if (VIR_STRNDUP(feature, p, next ? next - p - 1 : strlen(p)) < 0)
+ if (VIR_STRNDUP(feature, p, next ? next - p - 1 : -1) < 0)
goto error;
if (STREQ(feature, "kvmclock")) {
if (*p == '\0' || *p == ',')
goto syntax;
- if (VIR_STRNDUP(feature, p, next ? next - p - 1 : strlen(p)) < 0)
+ if (VIR_STRNDUP(feature, p, next ? next - p - 1 : -1) < 0)
goto error;
dom->features |= (1 << VIR_DOMAIN_FEATURE_HYPERV);
offset2 = strchr(offset, ',');
offset++;
if (VIR_STRNDUP(def->source.data.tcp.service, offset,
- offset2 ? offset2 - offset : strlen(offset)) < 0)
+ offset2 ? offset2 - offset : -1) < 0)
goto error;
if (offset2 && strstr(offset2, ",server"))
{
const char *offset = strchr(value, ',');
if (VIR_STRNDUP(def->source.data.nix.path, value,
- offset ? offset - value : strlen(value)) < 0)
+ offset ? offset - value : -1) < 0)
goto error;
if (offset != NULL &&