From 6da77e2c644d04e6e459d12a133730af22b8c1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Fri, 17 Aug 2018 16:39:49 +0200 Subject: [PATCH] Add documentation for parameters of string_from_unterminated --- src/helper_functions.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helper_functions.hpp b/src/helper_functions.hpp index d138490b..d70cbc1e 100644 --- a/src/helper_functions.hpp +++ b/src/helper_functions.hpp @@ -37,6 +37,13 @@ Convert a C style string that may or may not be null terminated safely into a std::string. The string's termination is either set at the first \0 or after data_length characters. + + @param[in] data A c-string from which the std::string shall be + constructed. Does not need to be null terminated. + @param[in] data_length An upper bound for the string length (must be at most + the allocated length of `buffer`). If no null terminator is found in data, + then the resulting std::string will be null terminated at `data_length`. + */ std::string string_from_unterminated(const char* data, size_t data_length);