diff options
| author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-10-14 13:11:08 -0400 |
|---|---|---|
| committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-10-14 14:09:34 -0400 |
| commit | 49ae05213e45a898863401a5f65f8b4b9242a6c2 (patch) | |
| tree | 8c641f7adf5387c40601cd335bac9bd4097c815b /src/common/string_util.h | |
| parent | 0196b5a01f7937d7770801408d05bc1836b478a0 (diff) | |
string_util: Make use of std::string_view and add bounds checking
Makes use of std::string_view in StringFromFixedZeroTerminatedBuffer and add bounds checking
Diffstat (limited to 'src/common/string_util.h')
| -rw-r--r-- | src/common/string_util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/string_util.h b/src/common/string_util.h index 7e90a9ca52..f0dd632eeb 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -63,7 +63,7 @@ template <typename InIt> * Creates a std::string from a fixed-size NUL-terminated char buffer. If the buffer isn't * NUL-terminated then the string ends at max_len characters. */ -[[nodiscard]] std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, +[[nodiscard]] std::string StringFromFixedZeroTerminatedBuffer(std::string_view buffer, std::size_t max_len); /** |
