mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Encoding 0 length data, returns '' instead of null
This commit is contained in:
@@ -170,7 +170,7 @@ enum encoding ParseEncoding(Handle<Value> encoding_v, enum encoding _default) {
|
||||
Local<Value> Encode(const void *buf, size_t len, enum encoding encoding) {
|
||||
HandleScope scope;
|
||||
|
||||
if (!len) return scope.Close(Null());
|
||||
if (!len) return scope.Close(String::Empty());
|
||||
|
||||
if (encoding == BINARY) {
|
||||
const unsigned char *cbuf = static_cast<const unsigned char*>(buf);
|
||||
|
||||
Reference in New Issue
Block a user