Update memsim.c

psuedo fix added.