diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-02-12 22:57:53 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-02-20 12:50:28 +0300 |
commit | d1f1fcfe0cea492152bcc8d008dc2ef59e2e0786 (patch) | |
tree | ee759f9140a3d9fe5b75f73d7fc57d86a918ff3c /src/string_bytes.cc | |
parent | 5421e15bdc6122420d90ec462c3622b57d59c9d6 (diff) |
src: avoid implicit type conversions (take 2)
This fixes more C4244 MSVC warnings in the code base.
Refs: https://github.com/nodejs/node/pull/37149
PR-URL: https://github.com/nodejs/node/pull/37334
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r-- | src/string_bytes.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 556dba97c09..daff1424d22 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -250,8 +250,8 @@ static size_t hex_decode(char* buf, const size_t srcLen) { size_t i; for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) { - unsigned a = unhex(src[i * 2 + 0]); - unsigned b = unhex(src[i * 2 + 1]); + unsigned a = unhex(static_cast<uint8_t>(src[i * 2 + 0])); + unsigned b = unhex(static_cast<uint8_t>(src[i * 2 + 1])); if (!~a || !~b) return i; buf[i] = (a << 4) | b; |