Fix out of bounds write in static char array