Add test for 1048945. The error was in the user's code. This code was corrected and...
[awesomized/libmemcached] / libmemcached / server_list.cc
index 537e9edd8dfb04e7817a22e369793b6072d8fc3d..5ead6fe929d9eb0481a845c3fcdf0c62fd5a51ba 100644 (file)
@@ -45,11 +45,11 @@ memcached_server_list_append_with_weight(memcached_server_list_st ptr,
                                          uint32_t weight,
                                          memcached_return_t *error)
 {
-  uint32_t count;
-
   memcached_return_t unused;
   if (error == NULL)
+  {
     error= &unused;
+  }
 
   if (hostname == NULL)
   {
@@ -60,14 +60,14 @@ memcached_server_list_append_with_weight(memcached_server_list_st ptr,
   {
     port = 0;
   }
-  else if (not port)
+  else if (port == 0)
   {
     port= MEMCACHED_DEFAULT_PORT;
   }
 
 
   /* Increment count for hosts */
-  count= 1;
+  uint32_t count= 1;
   if (ptr != NULL)
   {
     count+= memcached_server_list_count(ptr);