Slight tweaks to make string.cpp portable.

Just a small tweak to make string.cpp compile on other targets. I have tested this using Clang 4.2 on OSX and avr32-gcc 4.4.7. Without the tweak it cannot be built with Clang.