**/
#include "rrd.h"
-#include "rrd_client.h"
#include "rrd_tool.h"
+#include "rrd_client.h"
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <errno.h>
#include <assert.h>
#include <pthread.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netdb.h>
+#include <limits.h>
#ifndef ENODATA
#define ENODATA ENOENT
rrd_set_error("garbage after address: %s", port);
return (-1);
}
- } /* if (*addr = ']') */
- else if (strchr (addr, '.') != NULL) /* Hostname or IPv4 */
+ } /* if (*addr == '[') */
+ else
{
port = rindex(addr, ':');
if (port != NULL)