Module: sip-router Branch: master Commit: e5a5344290a351344c2451017d1d5677fe649cb8 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e5a5344290a351344c2451017d1d5677fe649cb8
Author: Jon Bonilla <ma...@aholab.ehu.es> Committer: Jon Bonilla <ma...@aholab.ehu.es> Date: Wed Sep 28 17:16:34 2011 +0200 ndb_redis: fix parsing of integer arguments from server connect string Reported and patch contributed by Andrew Pogrebennyk --- modules/ndb_redis/redis_client.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ndb_redis/redis_client.c b/modules/ndb_redis/redis_client.c index 6a91019..e8d74f6 100644 --- a/modules/ndb_redis/redis_client.c +++ b/modules/ndb_redis/redis_client.c @@ -71,10 +71,10 @@ int redisc_init(void) addr = pit->body.s; addr[pit->body.len] = '\0'; } else if(pit->name.len==4 && strncmp(pit->name.s, "port", 4)==0) { - if(!str2int(&pit->body, &port)) + if(!str2int(&pit->body, &port) < 0) port = 6379; } else if(pit->name.len==2 && strncmp(pit->name.s, "db", 2)==0) { - if(!str2int(&pit->body, &db)) + if(!str2int(&pit->body, &db) < 0) db = 0; } } _______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev