fixed invalid use of memcmp (range too short)