0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00

SafeStr: use std::numeric_limits instead of SIZE_MAX

It's the C++ way.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
Frank Lichtenheld 2022-01-12 17:54:39 +01:00
parent 88b0d28295
commit 307d5a4325

View File

@ -43,7 +43,7 @@ namespace openvpn {
SafeString(const char *str, const size_t size)
: data(size+1, BUF_FLAGS)
{
if (size == SIZE_MAX)
if (size == std::numeric_limits<size_t>::max())
OPENVPN_BUFFER_THROW(buffer_overflow)
data.write((unsigned char *)str, size);
trail();