Fix PR21428 for long. Buffer was one byte too small in octal formatting case. Rename previously added test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268009 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/locale b/include/locale
index d451278..b1cac28 100644
--- a/include/locale
+++ b/include/locale
@@ -1375,7 +1375,7 @@
this->__format_int(__fmt+1, __len, true, __iob.flags());
const unsigned __nbuf = (numeric_limits<long>::digits / 3)
+ ((numeric_limits<long>::digits % 3) != 0)
- + 1;
+ + 2;
char __nar[__nbuf];
int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
char* __ne = __nar + __nc;