Merge pull request #2144 from matt335672/remove_s_check

Remove s_check() macro
This commit is contained in:
matt335672 2022-02-14 09:00:21 +00:00 committed by GitHub
commit e1c6afa38e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -89,9 +89,6 @@ parser_stream_overflow_check(const struct stream *s, int n, int is_out,
# define S_CHECK_REM_OUT(s,n) # define S_CHECK_REM_OUT(s,n)
#endif #endif
/******************************************************************************/
#define s_check(s) s_check_rem(s, 0)
/******************************************************************************/ /******************************************************************************/
#define s_check_rem(s, n) ((s)->p + (n) <= (s)->end) #define s_check_rem(s, n) ((s)->p + (n) <= (s)->end)

View File

@ -1334,7 +1334,7 @@ clipboard_process_data_response(struct stream *s, int clip_msg_status,
return 0; return 0;
} }
index = 0; index = 0;
while (s_check(s)) while (s_check_rem(s, 2))
{ {
in_uint16_le(s, wchr); in_uint16_le(s, wchr);
wtext[index] = wchr; wtext[index] = wchr;

View File

@ -575,7 +575,7 @@ handle_cb_format_data_response(struct vnc *v, struct stream *s)
{ {
case CF_TEXT: case CF_TEXT:
lastc = '\0'; lastc = '\0';
while (s_check(s)) while (s_check_rem(s, 1))
{ {
in_uint8(s, c); in_uint8(s, c);
if (c == '\n' && lastc == '\r') if (c == '\n' && lastc == '\r')