tiny fix
fixing Undefined behaviour segfault under mingw

this was an error in the code, but appearing only under mingw gcc...