Skip to content
This repository was archived by the owner on Jul 6, 2018. It is now read-only.

Commit 8ea8668

Browse files
danbevjasnell
authored andcommitted
http2: cast numchars to size_t
Currently when building the following compiler warning is issued: ../src/node_http2_core.cc:204:16: warning: comparison of integers of different signs: 'ssize_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] if (numchars < length) { ~~~~~~~~ ^ ~~~~~~ 1 warning generated. numchars is checked to make sure it is greater than 0 so it should be safe to cast it to size_t. PR-URL: #172 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0d924a8 commit 8ea8668

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_http2_core.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ ssize_t Nghttp2Session::OnStreamReadFD(nghttp2_session* session,
201201
stream->fd_offset_ += numchars;
202202

203203
// if numchars < length, assume that we are done.
204-
if (numchars < length) {
204+
if (static_cast<size_t>(numchars) < length) {
205205
DEBUG_HTTP2("Nghttp2Session %d: no more data for stream %d\n",
206206
handle->session_type_, id);
207207
*flags |= NGHTTP2_DATA_FLAG_EOF;

0 commit comments

Comments
 (0)