Skip to content

Commit ba3b3f3

Browse files
committed
GCC warning on signed/unsigned comparison fixed
1 parent 15ece5a commit ba3b3f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/network/example/http/fileserver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <sys/fcntl.h>
1313
#include <unistd.h>
1414
#include <iostream>
15+
#include <cassert>
1516

1617
namespace http = boost::network::http;
1718
namespace utils = boost::network::utils;
@@ -142,7 +143,8 @@ struct connection_handler : boost::enable_shared_from_this<connection_handler> {
142143
void handle_chunk(std::pair<void *, std::size_t> mmaped_region, off_t offset,
143144
server::connection_ptr connection,
144145
boost::system::error_code const &ec) {
145-
if (!ec && offset < mmaped_region.second)
146+
assert(offset>=0);
147+
if (!ec && static_cast<std::size_t>(offset) < mmaped_region.second)
146148
send_file(mmaped_region, offset, connection);
147149
}
148150

0 commit comments

Comments
 (0)