From 0c64768cb4d9d12c4815dc2f21efe3d2934d6803 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 19 Mar 2010 11:46:09 -0700 Subject: [PATCH] Don't error out when buffer.utf8Write() doesn't fit --- src/node_buffer.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index cfc2b49f29..a2402939f3 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -232,11 +232,6 @@ Handle 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));