Fix unknown conversion from string to const char*

The code from the previous commit works on OS X with Xcode but not
with GCC's standard C++ library. On a GNU platform it needs the explicit
conversion from string to const char*. This commit fixes the bug.