提交 a81eb0b4 编写于 作者: D Daniel P. Berrange

Change s/i/iv/ in test code to avoid syntax-check

The code parsing VIR_TEST_RANGE mistakenly used 'unsigned int i'
which violated syntax-check rules
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 ab92ae33
......@@ -632,23 +632,23 @@ int virtTestMain(int argc,
if ((testRange = getenv("VIR_TEST_RANGE")) != NULL) {
char *end = NULL;
unsigned int i;
if (virStrToLong_ui(testRange, &end, 10, &i) < 0) {
unsigned int iv;
if (virStrToLong_ui(testRange, &end, 10, &iv) < 0) {
fprintf(stderr, "Cannot parse range %s\n", testRange);
return EXIT_FAILURE;
}
testStart = testEnd = i;
testStart = testEnd = iv;
if (end && *end) {
if (*end != '-') {
fprintf(stderr, "Cannot parse range %s\n", testRange);
return EXIT_FAILURE;
}
end++;
if (virStrToLong_ui(end, NULL, 10, &i) < 0) {
if (virStrToLong_ui(end, NULL, 10, &iv) < 0) {
fprintf(stderr, "Cannot parse range %s\n", testRange);
return EXIT_FAILURE;
}
testEnd = i;
testEnd = iv;
if (testEnd < testStart) {
fprintf(stderr, "Test range end %zu must be >= %zu\n", testEnd, testStart);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册