commit | f89f1379d45b1fb9ef903681d98696f50cd32b90 | [log] [tgz] |
---|---|---|
author | Ewout van Bekkum <ewout@google.com> | Mon May 03 11:15:54 2021 -0700 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu May 13 16:27:34 2021 +0000 |
tree | 1c52bf2c8161ae4f2bd4b5531ab4825ce4b046e1 | |
parent | e5412480f29902602e57c8fd75ceb7f478ec7e71 [diff] |
pw_string: redo pw::string::Length Moves and renames the existing pw::string::Length to pw::string::internal::ClampedLength. Instead two new helpers are added: 1) pw::string::NullTerminatedLength(...) which returns the length IFF the string is null terminated. 2) pw::string::ClampedCString(...) which returns a string_view of the clamped string. This is considered safer compared to strnlen_s and the existing internal::ClampedLength implementation, since sting_view does not require null termination. Change-Id: Ie6486df13b205332633f3970109ca97f578e6993 Requires: pigweed-internal:12460 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/43463 Reviewed-by: Ewout van Bekkum <ewout@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Reviewed-by: Keir Mierle <keir@google.com> Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
See our website: http://pigweed.dev