fix trivial MSVC sign-extension on unsigned type warning
fix infinite loop if linked against msvcr120, not msvcrt.dll