Make sure source strings are terminated (#1641)

* Make sure source strings are terminated

The source strings may or may not have a null terminator. We need to
make sure we add one before outputting the source strings as we iterate
over the c-str looking for the null terminator.

* Review feedback
2 files changed