diff --git a/absl/debugging/symbolize_elf.inc b/absl/debugging/symbolize_elf.inc index ae75cd4153d..e91500a3993 100644 --- a/absl/debugging/symbolize_elf.inc +++ b/absl/debugging/symbolize_elf.inc @@ -541,11 +541,9 @@ static ABSL_ATTRIBUTE_NOINLINE bool GetSectionHeaderByType( (buf_bytes > num_bytes_left) ? num_bytes_left : buf_bytes; const off_t offset = sh_offset + static_cast(i * sizeof(buf[0])); const ssize_t len = file->ReadFromOffset(buf, num_bytes_to_read, offset); - if (len < 0) { - ABSL_RAW_LOG( - WARNING, - "Reading %zu bytes from offset %ju returned %zd which is negative.", - num_bytes_to_read, static_cast(offset), len); + if (len <= 0) { + ABSL_RAW_LOG(WARNING, "Reading %zu bytes from offset %ju returned %zd.", + num_bytes_to_read, static_cast(offset), len); return false; } if (static_cast(len) % sizeof(buf[0]) != 0) {