libmemcached: fix #50 with supplied patch
[awesomized/libmemcached] / libmemcached / auto.cc
index 685528f2fae41adc40e8924016fdd3d8b88601c1..06e7ab6419646abb82121ce5d9a775fb5aaeaa07 100644 (file)
@@ -57,8 +57,13 @@ static void auto_response(memcached_instance_st* instance, const bool reply,  me
     assert(memcached_last_error(instance->root) != MEMCACHED_SUCCESS);
     *value= UINT64_MAX;
   }
+  else if (memcached_failed(rc))
+  {
+    *value= UINT64_MAX;
+  }
   else
   {
+    assert(memcached_last_error(instance->root) != MEMCACHED_NOTFOUND);
     *value= instance->root->result.numeric_value;
   }
 }
@@ -230,7 +235,7 @@ static memcached_return_t increment_decrement_with_initial_by_key(const protocol
   if (memcached_is_encrypted(memc))
   {
     return memcached_set_error(*memc, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT, 
-                               memcached_literal_param("Operation not allowed while encyrption is enabled"));
+                               memcached_literal_param("Operation not allowed while encryption is enabled"));
   }
 
   if (memcached_failed(rc= memcached_key_test(*memc, (const char **)&key, &key_length, 1)))