Comparing version 0.6.3 to 0.6.4
@@ -18,3 +18,3 @@ //binary data writer tuned for creating | ||
var oldBuffer = this.buffer; | ||
this.buffer = Buffer(oldBuffer.length + size); | ||
this.buffer = new Buffer(oldBuffer.length + size); | ||
oldBuffer.copy(this.buffer); | ||
@@ -44,10 +44,10 @@ } | ||
this._ensure(1); | ||
this.buffer[this.offset++] = 0; | ||
return this; | ||
} else { | ||
var len = Buffer.byteLength(string); | ||
this._ensure(len + 1); //+1 for null terminator | ||
this.buffer.write(string, this.offset, len); | ||
this.offset += len; | ||
} | ||
var len = Buffer.byteLength(string) + 1; | ||
this._ensure(len); | ||
this.buffer.write(string, this.offset); | ||
this.offset += len; | ||
this.buffer[this.offset] = 0; //add null terminator | ||
this.buffer[this.offset++] = 0; // null terminator | ||
return this; | ||
@@ -58,3 +58,3 @@ } | ||
this._ensure(1); | ||
this.buffer.write(char, this.offset); | ||
this.buffer.write(char, this.offset, 1); | ||
this.offset++; | ||
@@ -61,0 +61,0 @@ return this; |
{ "name": "pg", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -4,0 +4,0 @@ "keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"], |
@@ -121,2 +121,3 @@ #node-postgres | ||
* [tokumine](https://github.com/tokumine) | ||
* [shtylman](https://github.com/shtylman) | ||
@@ -123,0 +124,0 @@ ## Documentation |
198172
166
5272