folly/Conv.h: estimateSpaceNeeded: avoid undefined behavior
Summary: Do not negate signed numbers like INT_MIN or INTMAX_MIN, since
that would evoke undefined behavior. Otherwise, the test (below)
would fail with this run-time error:
[ RUN ] Conv.Integral2String
folly/Conv.h:521:47: runtime error: negation of -
2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Reviewed By: markisaa
Differential Revision:
D2704195
fb-gh-sync-id:
4036437fb972109672004163880078127e7df797