From: oetiker Date: Thu, 24 Nov 2011 10:55:18 +0000 (+0000) Subject: properly handle the case where RRDCACHED_ADDRESS is an empty string X-Git-Url: https://git.tokkee.org/?p=rrdtool-all.git;a=commitdiff_plain;h=614b5ff7ecd1a63ff4a8c6d361577f490448387c properly handle the case where RRDCACHED_ADDRESS is an empty string git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2220 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_client.c b/program/src/rrd_client.c index 51b2eb8a..5481ba3b 100644 --- a/program/src/rrd_client.c +++ b/program/src/rrd_client.c @@ -492,7 +492,7 @@ int rrdc_is_connected(const char *daemon_addr) /* {{{ */ * but it is not specified in the current command. * Daemon is only implied in this case if set in ENV */ - if (addr != NULL && ! strcmp(addr,"")) + if (addr != NULL && strcmp(addr,"") != 0) return 1; else return 0; @@ -657,7 +657,7 @@ int rrdc_connect (const char *addr) /* {{{ */ addr = getenv (ENV_RRDCACHED_ADDRESS); } - if (addr == NULL || ! strcmp(addr,"")) { + if (addr == NULL || strcmp(addr,"") == 0) { addr = NULL; return 0; }