Fix a buffer overflow in mapc