Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed APPEND with numeric strings

  • Loading branch information...
commit 5afe9e5ac90856c466c489c08c3a48d7f005fe0b 1 parent 57712ff
@tj authored
Showing with 5 additions and 1 deletion.
  1. +1 −0  lib/commands/string.js
  2. +4 −1 lib/connection.js
View
1  lib/commands/string.js
@@ -182,6 +182,7 @@ exports.strlen = function(client, key){
if (obj && 'string' != obj.type) return client.typeError();
if (obj) {
+ if (!Buffer.isBuffer(obj.val)) obj.val = new Buffer(obj.val.toString());
var offset = obj.val.length
, len = offset + str.length
, buf = new Buffer(len);
View
5 lib/connection.js
@@ -78,7 +78,10 @@ Connection.prototype.list = function(arr){
*/
Connection.prototype.send = function(data){
- var stream = this.stream;
+ var stream = this.stream
+ , data = 'number' == typeof data
+ ? data.toString()
+ : data;
stream.write('$' + data.length + '\r\n');
stream.write(data);
stream.write('\r\n');
Please sign in to comment.
Something went wrong with that request. Please try again.