platedetector: Do not write out of string boundaries

Change-Id: I7e6979cc8a33d1b8fa4b9c3cb8fd03fb8bc01004