Commit 87bdddaf authored by Daniel Bevenius's avatar Daniel Bevenius
Browse files

src: fix compiler warning in udp_wrap.cc

Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
  if (size != args[0].As<Uint32>()->Value()) {
      ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.

PR-URL: https://github.com/nodejs/node/pull/15402


Reviewed-By: default avatarFranziska Hinkelmann <franziska.hinkelmann@gmail.com>
parent 602fd36d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment