From a story where people no longer use keys for locks, but speak a special phrase into the lock:
On the other hand, people accidentally saying their phrase while drunk happens all the time. After coming home you sober up, but there's no need for regret or panic. From the inside you should replace the characters and fix to a different phrase.
I'm really confused by the sentence in bold. The story has been about people speaking these phrases. There is no mention of anything being written down or typed in. So what is the meaning of 字 here? I also don't really understand 文句になおす. Why is the particle に used instead of を?