fix ubsan warning

Signed-off-by: Asra Ali <asraa@google.com>
pull/6343/head
Asra Ali 6 years ago committed by Adam Cozzette
parent 8b09686253
commit de3e728c69
  1. 6
      src/google/protobuf/stubs/strutil.cc

@ -1065,10 +1065,12 @@ done:
}
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);
}

Loading…
Cancel
Save