Skip to content
Snippets Groups Projects
Commit 37a69c5c authored by Florian Loitsch's avatar Florian Loitsch
Browse files

Null terminate exponent buffer.

Fixes issue 26.
parent 1f0942e8
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,8 @@ void DoubleToStringConverter::CreateExponentialRepresentation(
}
ASSERT(exponent < 1e4);
const int kMaxExponentLength = 5;
char buffer[kMaxExponentLength];
char buffer[kMaxExponentLength + 1];
buffer[kMaxExponentLength] = '\0';
int first_char_pos = kMaxExponentLength;
while (exponent > 0) {
buffer[--first_char_pos] = '0' + (exponent % 10);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment