fix a mistake of 803408f18 spotted by n1s

When the source string terminates (with a 0) we pad the rest of the
destination with spaces.
This commit is contained in:
Rafaël Carré 2012-05-07 12:54:11 -04:00
parent 7803f31c53
commit dae7a29b35

View file

@ -1218,7 +1218,7 @@ static void send_csw(int status)
static void copy_padded(char *dest, char *src, int len)
{
for (int i = 0; i < len; i++) {
if (src[i] != 0) {
if (src[i] == '\0') {
memset(&dest[i], ' ', len - i);
return;
}