| commit | 56e23d71af87ebecb63b02b1685a393b526a0cbb | [log] [tgz] |
|---|---|---|
| author | Florian Loitsch <florian@loitsch.com> | Sun Jun 10 20:00:03 2012 +0200 |
| committer | Florian Loitsch <florian@loitsch.com> | Sun Jun 10 20:00:03 2012 +0200 |
| tree | 7bec910a90decb21f41a44121ac9ae8e231f195e | |
| parent | 6ed201632a35a0ae8502c8315594e46ce9095db4 [diff] | |
| parent | 37a69c5cae5e110cc770637d5032f1e203a2fc77 [diff] |
Merge branch 'fix_null_termination'
diff --git a/src/double-conversion.cc b/src/double-conversion.cc index c3149e8..a79fe92 100644 --- a/src/double-conversion.cc +++ b/src/double-conversion.cc
@@ -98,7 +98,8 @@ } 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);