pioz / chess

A fast chess library that use bitboards to play chess with Ruby
GNU Lesser General Public License v3.0
59 stars 17 forks source link

Allocating an extra byte for string termination in print_board #5

Closed jer closed 9 years ago

jer commented 9 years ago

For issue #4

The board text is 250 characters, which doesn't leave room for null termination. I can't think of any way to test this, but the numbers all seem to add up.

jer commented 9 years ago

I went ahead and ran Valgrind before and after the fix. This seems to show that it clears things up.

Before: https://gist.github.com/jer/882015c81a39984f107a

After: https://gist.github.com/jer/6fe6373482a8588eb6c2

jer commented 9 years ago

Any thoughts on this? Seems like a simple enough fix.

pioz commented 9 years ago

Sorry for delay. I've merged your pull request. Does this fix the Heroku problem (https://github.com/pioz/chess/issues/4)?