diff --git a/virtrust/src/virtrust/api/domain.cpp b/virtrust/src/virtrust/api/domain.cpp index 9d3998f3397d86c85993590d2eec4a480ae97e41..8e267cedd85661542827b715b83e1272c2c3ca52 100644 --- a/virtrust/src/virtrust/api/domain.cpp +++ b/virtrust/src/virtrust/api/domain.cpp @@ -344,7 +344,7 @@ VirtrustRc ValidateAndPrepareArgs(const std::vector &args, std::vec return VirtrustRc::ERROR; } (void)GetConnectArgs(arg, connectArgs, i, args); - execArgs.push_back(const_cast(arg.c_str())); + execArgs.push_back(const_cast(arg.data())); } execArgs.push_back(const_cast("--noautoconsole")); execArgs.push_back(const_cast("--noreboot")); @@ -355,7 +355,7 @@ VirtrustRc ValidateAndPrepareArgs(const std::vector &args, std::vec if (connectArgs.empty()) { execArgs.reserve(args.size() + 5); execArgs.push_back(const_cast("--connect")); - execArgs.push_back(strdup(conn->GetUri().c_str())); + execArgs.push_back(strdup(conn->GetUri().data())); } else { conn->SetUri(connectArgs); } @@ -398,7 +398,7 @@ VirtrustRc CreateDomainAndVRoot(const std::unique_ptr &conn, const std: } Description description{}; description.state = 0; - if (strncpy_s(description.name, sizeof(description.name), domainName.c_str(), sizeof(description.name) - 1) != + if (strncpy_s(description.name, sizeof(description.name), domainName.data(), sizeof(description.name) - 1) != EOK) { VIRTRUST_LOG_ERROR("|DomainCreate|END|returnF||strncpy_s domainName failed.");