summaryrefslogtreecommitdiff
path: root/src/node_buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_buffer.cc')
-rw-r--r--src/node_buffer.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index e6a88f6498..d3a9abc571 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -843,7 +843,7 @@ void IndexOfString(const FunctionCallbackInfo<Value>& args) {
if (IsBigEndian()) {
StringBytes::InlineDecoder decoder;
- if (decoder.Decode(env, needle, args[3], UCS2).IsNothing()) return;
+ if (decoder.Decode(env, needle, enc).IsNothing()) return;
const uint16_t* decoded_string =
reinterpret_cast<const uint16_t*>(decoder.out());