Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/google/protobuf/stubs/strutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,12 @@ char* FastUInt64ToBufferLeft(uint64 u64, char* buffer) {
}

char* FastInt64ToBufferLeft(int64 i, char* buffer) {
uint64 u = i;
uint64 u = 0;
if (i < 0) {
*buffer++ = '-';
u = -i;
u -= i;
} else {
u = i;
}
return FastUInt64ToBufferLeft(u, buffer);
}
Expand Down
4 changes: 3 additions & 1 deletion src/google/protobuf/text_format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,9 @@ class TextFormat::Printer::TextGenerator
while (size > buffer_size_) {
// Data exceeds space in the buffer. Write what we can and request a new
// buffer.
memset(buffer_, ' ', buffer_size_);
if (buffer_size_ > 0) {
memset(buffer_, ' ', buffer_size_);
}
size -= buffer_size_;
void* void_buffer;
failed_ = !output_->Next(&void_buffer, &buffer_size_);
Expand Down