[PATCH] cmd/mem.c: fix undefined behavior in mem cmp