vigenere: Corrected buffer overruns

We used to read more than the whole string by not checking the right
termination condition.

Signed-off-by: Celelibi <celelibi@gmail.com>