Browse Source

Don't error out when buffer.utf8Write() doesn't fit

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
0c64768cb4
  1. 5
      src/node_buffer.cc

5
src/node_buffer.cc

@ -232,11 +232,6 @@ Handle<Value> Buffer::Utf8Write(const Arguments &args) {
const char *p = buffer->data_ + offset; const char *p = buffer->data_ + offset;
if (s->Length() + offset > buffer->length_) {
return ThrowException(Exception::TypeError(String::New(
"Not enough space in Buffer for string")));
}
int written = s->WriteUtf8((char*)p, buffer->length_ - offset); int written = s->WriteUtf8((char*)p, buffer->length_ - offset);
return scope.Close(Integer::New(written)); return scope.Close(Integer::New(written));

Loading…
Cancel
Save