Skip to content

Commit

Permalink
ensure args count for incr/incrby
Browse files Browse the repository at this point in the history
  • Loading branch information
KDr2 committed Jun 9, 2014
1 parent 1401e23 commit c7e7426
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/rl_kv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@

void RLRequest::rl_incr(){

if(args.size()!=1){
connection->write_error("ERR wrong number of arguments for 'incr' command");
return;
}

std::string out;
leveldb::Status status;

Expand Down Expand Up @@ -72,6 +77,11 @@ void RLRequest::rl_incr(){

void RLRequest::rl_incrby(){

if(args.size()!=2){
connection->write_error("ERR wrong number of arguments for 'incrby' command");
return;
}

std::string out;
leveldb::Status status;
status = connection->server->db[connection->db_index]->Get(connection->server->read_options,
Expand Down

0 comments on commit c7e7426

Please sign in to comment.