Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Don't error out when buffer.utf8Write() doesn't fit
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 19, 2010
1 parent f8c3b60 commit 0c64768
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/node_buffer.cc
Expand Up @@ -232,11 +232,6 @@ Handle<Value> Buffer::Utf8Write(const Arguments &args) {

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);

return scope.Close(Integer::New(written));
Expand Down

0 comments on commit 0c64768

Please sign in to comment.