Update memsim.c

That should fix everything.