The input string doesn't need to be null-terminated.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I1ae0be22ee44fc4b7969525224f0721689a12dd1
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12760
#include "common/assert.h"
#include "common/uuid.h"
-#include "cpp-common/bt2c/c-string-view.hpp"
+#include "cpp-common/bt2s/string-view.hpp"
namespace bt2c {
this->_setFromPtr(uuid);
}
- explicit Uuid(const CStringView str) noexcept
+ explicit Uuid(const bt2s::string_view str) noexcept
{
- const auto ret = bt_uuid_from_c_str(str.data(), _mUuid.data());
+ const auto ret = bt_uuid_from_str(str.data(), str.data() + str.size(), _mUuid.data());
BT_ASSERT(ret == 0);
}