From f9bb1f49970eb9a41c517f387f46783c4c9f8b4c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 29 Apr 2022 10:31:24 +0100 Subject: [PATCH] ssh/verstring.c: fix use of '\r' and '\n'. It's a thoroughly pedantic point, but I just spotted that the comparison of wire data against theoretically platform-dependent char escapes is a violation of \k{udp-portability}. --- ssh/verstring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh/verstring.c b/ssh/verstring.c index 90814bc1..4671903a 100644 --- a/ssh/verstring.c +++ b/ssh/verstring.c @@ -309,8 +309,8 @@ void ssh_verstring_handle_input(BinaryPacketProtocol *bpp) * a NUL terminator. */ while (s->vstring->len > 0 && - (s->vstring->s[s->vstring->len-1] == '\r' || - s->vstring->s[s->vstring->len-1] == '\n')) + (s->vstring->s[s->vstring->len-1] == '\015' || + s->vstring->s[s->vstring->len-1] == '\012')) strbuf_shrink_by(s->vstring, 1); bpp_logevent("Remote version: %s", s->vstring->s);