diff --git a/src/node_buffer.cc b/src/node_buffer.cc index c16b5cb242..61b210ccce 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -331,7 +331,7 @@ Handle Buffer::AsciiSlice(const Arguments &args) { #endif char* data = parent->data() + start; - Local string = String::New(reinterpret_cast(data), end - start); + Local string = String::New(data, end - start); return scope.Close(string); } @@ -342,7 +342,7 @@ Handle Buffer::Utf8Slice(const Arguments &args) { Buffer *parent = ObjectWrap::Unwrap(args.This()); SLICE_ARGS(args[0], args[1]) char *data = parent->data() + start; - Local string = String::New(reinterpret_cast(data), end - start); + Local string = String::New(data, end - start); return scope.Close(string); } @@ -532,7 +532,7 @@ Handle Buffer::Utf8Write(const Arguments &args) { int char_written; - int written = s->WriteUtf8(reinterpret_cast(p), + int written = s->WriteUtf8(p, max_length, &char_written, String::HINT_MANY_WRITES_EXPECTED); @@ -572,7 +572,7 @@ Handle Buffer::AsciiWrite(const Arguments &args) { char *p = buffer->data() + offset; - int written = s->WriteAscii(reinterpret_cast(p), + int written = s->WriteAscii(p, 0, max_length, String::HINT_MANY_WRITES_EXPECTED);