This commit is contained in:
abachrach 2014-02-10 12:11:46 -08:00
commit 3cfe8193ee

View File

@ -856,7 +856,7 @@ void BasicWriter<Char>::FormatInt(T value, const Spec &spec) {
case 'o': { case 'o': {
UnsignedType n = abs_value; UnsignedType n = abs_value;
bool print_prefix = spec.hash_flag(); bool print_prefix = spec.hash_flag();
if (print_prefix) ++size; if (print_prefix) size+=2;
do { do {
++size; ++size;
} while ((n >>= 3) != 0); } while ((n >>= 3) != 0);
@ -865,8 +865,10 @@ void BasicWriter<Char>::FormatInt(T value, const Spec &spec) {
do { do {
*p-- = '0' + (n & 7); *p-- = '0' + (n & 7);
} while ((n >>= 3) != 0); } while ((n >>= 3) != 0);
if (print_prefix) if (print_prefix){
*p-- = spec.type();
*p = '0'; *p = '0';
}
break; break;
} }
default: default: