Fix narrowing conversion.

GitOrigin-RevId: c9f9fe9be4285b82e875140900065e328b8df32f
This commit is contained in:
levlam 2018-02-03 23:13:05 +03:00
parent 79df9bac53
commit 901e8cb224

View File

@ -81,7 +81,7 @@ StringBuilder &StringBuilder::operator<<(double x) {
auto left = end_ptr_ + reserved_size - current_ptr_;
if (unlikely(len >= left)) {
error_flag_ = true;
len = left - 1;
len = left ? narrow_cast<int>(left - 1) : 0;
}
ss->read(current_ptr_, len);
current_ptr_ += len;