posix: fixed memset... when while(n--) breaks because the condition is false, n will be post-decremented and become -1. This breaks many things. Unroll the loops.