Fix for a crash - seems like the code was assuming that the returned string was zero terminated, and I don't think it is...