drfeelngood/ctdb-rb — pull request #17 by GrumpyRainbow (2013-11-12 02:21:54+00:00)
Title: Fix seg fault on CT::Date#to_s

## Description

It was discovered that flushing the stdout prior to returning rb_str_new_cstr fixed the issue of the segmentation fault on CT::Date#to_s. The following two screenshots show the results of calling CT::Date#to_s before and after the changes in this pull request:

![screen shot 2013-11-11 at 7 39 04 pm](https://f.cloud.github.com/assets/1584123/1518732/ba9c349a-4b40-11e3-8237-b64ac0781317.png)

![screen shot 2013-11-11 at 7 41 27 pm](https://f.cloud.github.com/assets/1584123/1518734/c0802aba-4b40-11e3-83d4-4b5b7233fa00.png)

## Testing

All tests are passing!

Loaded Suite

Started at 2013-11-11 20:20:31 -0600 w/ seed 51052.

TestCTDate
PASS (0:00:00.000) test_from_date
PASS (0:00:00.000) test_new
PASS (0:00:00.000) test_to_date
PASS (0:00:00.000) test_today

TestCTTime
PASS (0:00:00.001) test_from_time
PASS (0:00:00.001) test_hour_min_and_sec
PASS (0:00:00.001) test_now
PASS (0:00:00.002) test_to_time
PASS (0:00:00.002) test_unpack

Finished in 0.002912 seconds.

9 tests, 9 passed, 0 failures, 0 errors, 0 skips, 39 assertions

Loaded Suite

Started at 2013-11-11 20:20:31 -0600 w/ seed 11113.

TestCTSession
PASS (0:00:00.003) test_connection_attributes
PASS (0:00:00.005) test_locking
PASS (0:00:00.016) test_logon_logout
PASS (0:00:00.016) test_path_prefix

Finished in 0.016876 seconds.

4 tests, 4 passed, 0 failures, 0 errors, 0 skips, 25 assertions

Loaded Suite

Started at 2013-11-11 20:20:32 -0600 w/ seed 54963.

TestCTTable
PASS (0:00:00.016) test_create
PASS (0:00:00.026) test_create_index
PASS (0:00:00.030) test_table_attributes

Finished in 0.030207 seconds.

3 tests, 3 passed, 0 failures, 0 errors, 0 skips, 60 assertions

Loaded Suite

Started at 2013-11-11 20:20:32 -0600 w/ seed 35257.

TestCTField
PASS (0:00:00.007) test_properties

Finished in 0.007984 seconds.

1 tests, 1 passed, 0 failures, 0 errors, 0 skips, 122 assertions

Loaded Suite

Started at 2013-11-11 20:20:32 -0600 w/ seed 60092.

TestCTRecord
PASS (0:00:00.010) test_create
PASS (0:00:00.016) test_find_eq
PASS (0:00:00.030) test_find_first
PASS (0:00:00.040) test_find_last
PASS (0:00:00.049) test_navigation
PASS (0:00:00.058) test_record_locking

Finished in 0.058429 seconds.

6 tests, 6 passed, 0 failures, 0 errors, 0 skips, 178 assertions

Loaded Suite

Started at 2013-11-11 20:20:32 -0600 w/ seed 11481.

TestQuery
PASS (0:00:00.006) test_all
PASS (0:00:00.009) test_each
PASS (0:00:00.020) test_each_on_empty_set
PASS (0:00:00.034) test_find_eq
PASS (0:00:00.042) test_find_first
PASS (0:00:00.053) test_find_ge
PASS (0:00:00.065) test_find_gt
PASS (0:00:00.076) test_find_last
PASS (0:00:00.087) test_find_le
PASS (0:00:00.099) test_find_lt
PASS (0:00:00.114) test_find_set
PASS (0:00:00.121) test_options

Finished in 0.121233 seconds.

12 tests, 12 passed, 0 failures, 0 errors, 0 skips, 41 assertions

Loaded Suite

Started at 2013-11-11 20:20:32 -0600 w/ seed 64466.

TestCTModel
PASS (0:00:00.012) test_all
PASS (0:00:00.014) test_attribute_helpers
PASS (0:00:00.016) test_count
PASS (0:00:00.022) test_create
PASS (0:00:00.025) test_destroy
PASS (0:00:00.029) test_each
PASS (0:00:00.032) test_find_by
PASS (0:00:00.036) test_first
PASS (0:00:00.039) test_last
PASS (0:00:00.041) test_new
PASS (0:00:00.045) test_save

Finished in 0.045209 seconds.

11 tests, 11 passed, 0 failures, 0 errors, 0 skips, 165 assertions