diff options
Diffstat (limited to 'absl/debugging/symbolize_darwin.inc')
-rw-r--r-- | absl/debugging/symbolize_darwin.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/debugging/symbolize_darwin.inc b/absl/debugging/symbolize_darwin.inc index 443ce9ef..cf63d191 100644 --- a/absl/debugging/symbolize_darwin.inc +++ b/absl/debugging/symbolize_darwin.inc @@ -83,13 +83,14 @@ bool Symbolize(const void* pc, char* out, int out_size) { memmove(out, tmp_buf, len + 1); } } else { - strncpy(out, symbol.c_str(), out_size); + strncpy(out, symbol.c_str(), static_cast<size_t>(out_size)); } if (out[out_size - 1] != '\0') { // strncpy() does not '\0' terminate when it truncates. static constexpr char kEllipsis[] = "..."; - int ellipsis_size = std::min<int>(sizeof(kEllipsis) - 1, out_size - 1); + size_t ellipsis_size = + std::min(sizeof(kEllipsis) - 1, static_cast<size_t>(out_size) - 1); memcpy(out + out_size - ellipsis_size - 1, kEllipsis, ellipsis_size); out[out_size - 1] = '\0'; } |