From e6c098e750ec232a87a55b2cc1120fe5e1ee2312 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Wed, 9 Feb 2022 10:18:15 +0000 Subject: [PATCH] Remove s_check() macro --- common/parse.h | 3 --- sesman/chansrv/clipboard.c | 2 +- vnc/vnc_clip.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/common/parse.h b/common/parse.h index b27bb0c9..a3721ef8 100644 --- a/common/parse.h +++ b/common/parse.h @@ -89,9 +89,6 @@ parser_stream_overflow_check(const struct stream *s, int n, int is_out, # define S_CHECK_REM_OUT(s,n) #endif -/******************************************************************************/ -#define s_check(s) s_check_rem(s, 0) - /******************************************************************************/ #define s_check_rem(s, n) ((s)->p + (n) <= (s)->end) diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c index e2a716ef..d5422483 100644 --- a/sesman/chansrv/clipboard.c +++ b/sesman/chansrv/clipboard.c @@ -1334,7 +1334,7 @@ clipboard_process_data_response(struct stream *s, int clip_msg_status, return 0; } index = 0; - while (s_check(s)) + while (s_check_rem(s, 2)) { in_uint16_le(s, wchr); wtext[index] = wchr; diff --git a/vnc/vnc_clip.c b/vnc/vnc_clip.c index ebbfae36..364bdff7 100644 --- a/vnc/vnc_clip.c +++ b/vnc/vnc_clip.c @@ -575,7 +575,7 @@ handle_cb_format_data_response(struct vnc *v, struct stream *s) { case CF_TEXT: lastc = '\0'; - while (s_check(s)) + while (s_check_rem(s, 1)) { in_uint8(s, c); if (c == '\n' && lastc == '\r')