Fix memory corruption in character store

Fix compiler warning