You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
312 B
C++
14 lines
312 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "helper_functions.hpp"
|
|
|
|
#include <cstring>
|
|
|
|
std::string string_from_unterminated(const char* data, size_t data_length) {
|
|
if (data_length == 0) {
|
|
return {};
|
|
}
|
|
const size_t StringLength = strnlen(data, data_length);
|
|
return {data, StringLength};
|
|
}
|