Skip over "host=" when getting info from conninfo string.
authorBo Peng <pengbo@sraoss.co.jp>
Mon, 18 Feb 2019 06:18:15 +0000 (15:18 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Mon, 18 Feb 2019 06:18:15 +0000 (15:18 +0900)
Patch provided by Nathan Ward.

src/main/pgpool_main.c

index 2c04d2958663820ac1b1e8f9ffe86852ba5dc05c..718f4d4597e683d6388e9f7ba52d5a6b5876ff1b 100644 (file)
@@ -4337,6 +4337,10 @@ get_info_from_conninfo(char *conninfo, char *host, char *port)
        p = strstr(conninfo, "host");
        if (p)
        {
+               /* skip "host=" */
+               while (*p && *p++ != '=')
+                       ;
+
                while (*p && *p != ' ')
                        *host++ = *p++;
                *host = '\0';