summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-08-06 10:16:46 -0400
committerantirez <antirez@gmail.com>2014-08-27 10:30:42 +0200
commit4ac8472cac9c017ba103c6eec00f33f917d1eb1a (patch)
treeed63a4f81704ad08a76a46ce34303714415b266b /src
parentf7b5e2d11e3eb97a7c16eb72a871af6ae585328d (diff)
downloadredis-4ac8472cac9c017ba103c6eec00f33f917d1eb1a.tar.gz
Rename two 'buf' vars to 'ip' for better clarity
Clearly ip[32] is wrong, but it's less clear that buf[32] was wrong without further reading.
Diffstat (limited to 'src')
-rw-r--r--src/sentinel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index e8630a9a8..603cdd404 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -456,19 +456,19 @@ void sentinelIsRunning(void) {
* EINVAL: Invalid port number.
*/
sentinelAddr *createSentinelAddr(char *hostname, int port) {
- char buf[REDIS_IP_STR_LEN];
+ char ip[REDIS_IP_STR_LEN];
sentinelAddr *sa;
if (port <= 0 || port > 65535) {
errno = EINVAL;
return NULL;
}
- if (anetResolve(NULL,hostname,buf,sizeof(buf)) == ANET_ERR) {
+ if (anetResolve(NULL,hostname,ip,sizeof(ip)) == ANET_ERR) {
errno = ENOENT;
return NULL;
}
sa = zmalloc(sizeof(*sa));
- sa->ip = sdsnew(buf);
+ sa->ip = sdsnew(ip);
sa->port = port;
return sa;
}
@@ -2690,7 +2690,7 @@ void sentinelCommand(redisClient *c) {
/* SENTINEL MONITOR <name> <ip> <port> <quorum> */
sentinelRedisInstance *ri;
long quorum, port;
- char buf[REDIS_IP_STR_LEN];
+ char ip[REDIS_IP_STR_LEN];
if (c->argc != 6) goto numargserr;
if (getLongFromObjectOrReply(c,c->argv[5],&quorum,"Invalid quorum")
@@ -2700,7 +2700,7 @@ void sentinelCommand(redisClient *c) {
/* Make sure the IP field is actually a valid IP before passing it
* to createSentinelRedisInstance(), otherwise we may trigger a
* DNS lookup at runtime. */
- if (anetResolveIP(NULL,c->argv[3]->ptr,buf,sizeof(buf)) == ANET_ERR) {
+ if (anetResolveIP(NULL,c->argv[3]->ptr,ip,sizeof(ip)) == ANET_ERR) {
addReplyError(c,"Invalid IP address specified");
return;
}