Also, using memcmp() here is potentially wrong. The struct may have holes in it that contain garbage.