diff --git a/clients/upsclient.c b/clients/upsclient.c index 835c425087..65ed611815 100644 --- a/clients/upsclient.c +++ b/clients/upsclient.c @@ -1689,6 +1689,16 @@ int upscli_splitaddr(const char *buf, char **hostname, uint16_t *port) return -1; } + s = strchr(tmp, '@'); + + /* someone passed a "@hostname" string? */ + if (s) { + fprintf(stderr, "upscli_splitaddr: wrong call? " + "Got upsname@hostname[:port] string where " + "only hostname[:port] was expected: %s\n", buf); + /* let it pass, but probably fail later */ + } + if (*tmp == '[') { if (strchr(tmp, ']') == NULL) { fprintf(stderr, "upscli_splitaddr: missing closing bracket in [domain literal]\n");