Skip to content

Commit

Permalink
fix ubsan warning
Browse files Browse the repository at this point in the history
Signed-off-by: Asra Ali <asraa@google.com>
  • Loading branch information
asraa authored and acozzette committed Jul 3, 2019
1 parent 8b09686 commit de3e728
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/google/protobuf/stubs/strutil.cc
Expand Up @@ -1065,10 +1065,12 @@ char* FastUInt32ToBufferLeft(uint32 u, char* buffer) {
}

char* FastInt32ToBufferLeft(int32 i, char* buffer) {
uint32 u = i;
uint32 u = 0;
if (i < 0) {
*buffer++ = '-';
u = -i;
u -= i;
} else {
u = i;
}
return FastUInt32ToBufferLeft(u, buffer);
}
Expand Down

0 comments on commit de3e728

Please sign in to comment.