added std::max to avoid buffer overflow in printing (#25)

[ROCm/rccl-tests commit: 9d3a53dfa3]
このコミットが含まれているのは:
akolliasAMD
2022-11-01 11:34:55 -06:00
committed by GitHub
コミット 1db5cf9986
+1 -1
ファイルの表示
@@ -652,7 +652,7 @@ testResult_t TimeTest(struct threadArgs* args, ncclDataType_t type, const char*
setupArgs(size, type, args);
char rootName[100];
sprintf(rootName, "%6i", root);
PRINT("%12li %12li %8s %6s %6s", (size_t)max(args->sendBytes, args->expectedBytes), args->nbytes / wordSize(type), typeName, opName, rootName);
PRINT("%12li %12li %8s %6s %6s", std::max(args->sendBytes, args->expectedBytes), args->nbytes / wordSize(type), typeName, opName, rootName);
TESTCHECK(BenchTime(args, type, op, root, 0));
usleep(delay_inout_place);
TESTCHECK(BenchTime(args, type, op, root, 1));