Fixed an off by one error in allocating the expanded string during expansion.  Now all three hits from the test query produce identical output in both the C and C++ versions.