vtysh: fix oversight in vtysh buffer rewrite

end can be NULL and shouldn't be adjusted in that case.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2016-10-19 14:38:48 +02:00 committed by Donald Sharp
parent 41246cb614
commit 2d35a720b9

View File

@ -185,7 +185,8 @@ vtysh_client_run (struct vtysh_client *vclient, const char *line, FILE *fp)
memmove (buf, eol, bufvalid - eol); memmove (buf, eol, bufvalid - eol);
bufvalid -= eol - buf; bufvalid -= eol - buf;
end -= eol - buf; if (end)
end -= eol - buf;
} }
if (bufvalid == buf + bufsz) if (bufvalid == buf + bufsz)