Make buffer related function conversion explicit when narrowing
Clang and gcc do report many of the narrowing conversion that MSVC
reports, like these:
warning C4267: 'function': conversion from 'size_t' to 'int', possible
loss of data
This commit changes int to size_t where it is safe
(e.g. checked by buf_size_valid) and add casts where necessary.
In the function buffer_read_from_file the return value of fread is
size_t (at least on Linux/Windows/macOS and cppreference), so fix the
check to actually make sense.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <
20210324222330.455-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21805.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>