Fix StringPiece compile issue in Chromium.

Change-Id: I5a29f690a4512252d0d5730492f7fd4cec16ffaa
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4262547
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Justin 2023-02-16 14:59:46 -05:00 committed by Crashpad LUCI CQ
parent 04b2ab5bba
commit 70e0f92153

View File

@ -316,8 +316,10 @@ class RingBufferAnnotationSnapshot final {
base::StringPiece str(reinterpret_cast<const char*>(&bytes[0]), base::StringPiece str(reinterpret_cast<const char*>(&bytes[0]),
bytes.size()); bytes.size());
if (!HexStringToInt(str, &next_value)) { if (!HexStringToInt(str, &next_value)) {
fprintf( fprintf(stderr,
stderr, "Couldn't parse value: [%s]\n", str.as_string().c_str()); "Couldn't parse value: [%.*s]\n",
base::checked_cast<int>(bytes.size()),
bytes.data());
abort(); abort();
} }
if (value == std::numeric_limits<int>::max()) { if (value == std::numeric_limits<int>::max()) {