From 9a69284d4fb2e9130fd60e3c03005d10d1b8638f Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Sun, 26 May 2024 07:25:35 +0200 Subject: emscripted/32-bit: Avoid dead-code comparison (error) --- src/byte_stream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/byte_stream.cpp b/src/byte_stream.cpp index 82403fe..127c857 100644 --- a/src/byte_stream.cpp +++ b/src/byte_stream.cpp @@ -30,6 +30,7 @@ // #include +#include #include #include @@ -209,7 +210,8 @@ size_t ByteInStream_File::read(void* out, size_t length) noexcept { } size_t ByteInStream_File::peek(void* out, size_t length, size_t offset) noexcept { - if( 0 == length || !good() || offset > std::numeric_limits::max() || + if( 0 == length || !good() || + ( sizeof(size_t) >= sizeof(off64_t) && offset > std::numeric_limits::max() ) || ( m_has_content_length && m_content_size - m_bytes_consumed < offset + 1 /* min number of bytes to read */ ) ) { return 0; } -- cgit v1.2.3