Fix potential security problem with escaping a % at the end of a very long password