projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge.
[awesomized/libmemcached]
/
libmemcached
/
memcached_hosts.c
diff --git
a/libmemcached/memcached_hosts.c
b/libmemcached/memcached_hosts.c
index 79e88701f63b66871b7753dea54fa84c9019ce79..34bbf68941b055253c8101680e95c74c9f2c30c7 100644
(file)
--- a/
libmemcached/memcached_hosts.c
+++ b/
libmemcached/memcached_hosts.c
@@
-361,9
+361,10
@@
memcached_return memcached_server_remove(memcached_server_st *st_ptr)
for (x= 0, index= 0; x < ptr->number_of_hosts; x++)
{
for (x= 0, index= 0; x < ptr->number_of_hosts; x++)
{
- if (strncmp(list[x].hostname, st_ptr->hostname, MEMCACHED_MAX_HOST_LENGTH)
!=
0 || list[x].port != st_ptr->port)
+ if (strncmp(list[x].hostname, st_ptr->hostname, MEMCACHED_MAX_HOST_LENGTH)
!=
0 || list[x].port != st_ptr->port)
{
{
- memcpy(list+index, list+x, sizeof(memcached_server_st));
+ if (index != x)
+ memcpy(list+index, list+x, sizeof(memcached_server_st));
index++;
}
}
index++;
}
}