X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FFormat.cpp;h=feec8fb255c3f9b4c15807e22f43e9433aad56d8;hb=65902504332d7f856a1fa407b0930ab5cc55fb2a;hp=53a218622d812a7bb6fe63b2baf5e99d0e5b4682;hpb=ce64f0f685111ac24c7a321ea56d0c3524621df1;p=folly.git diff --git a/folly/Format.cpp b/folly/Format.cpp index 53a21862..feec8fb2 100644 --- a/folly/Format.cpp +++ b/folly/Format.cpp @@ -96,7 +96,15 @@ void FormatArg::initSlow() { while (p != end && *p >= '0' && *p <= '9') { ++p; } - precision = to(StringPiece(b, p)); + if (p != b) { + precision = to(StringPiece(b, p)); + if (p != end && *p == '.') { + trailingDot = true; + ++p; + } + } else { + trailingDot = true; + } if (p == end) return; }