1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-20 02:42:09 +03:00

src: add and use LIBSSH2_MIN/MAX macros

Also for #797

Closes #974
This commit is contained in:
Viktor Szakats
2023-04-16 15:48:59 +00:00
parent 78cb64a859
commit 9ffbb05b44
4 changed files with 11 additions and 12 deletions

View File

@@ -156,6 +156,9 @@ struct iovec {
#define UINT_MAX 0xFFFFFFFF
#endif
#define LIBSSH2_MAX(x, y) ((x) > (y) ? (x) : (y))
#define LIBSSH2_MIN(x, y) ((x) < (y) ? (x) : (y))
/* RFC4253 section 6.1 Maximum Packet Length says:
*
* "All implementations MUST be able to process packets with