Silence potential compiler complaint

*We* know the target buffer is sufficiently sized to accept the
source string, but the compiler doesn't.
This commit is contained in:
Ian Barwick
2020-10-20 09:51:49 +09:00
parent 8f3994b071
commit 397e0ed5be

View File

@@ -5854,8 +5854,9 @@ is_downstream_node_attached(PGconn *conn, char *node_name, char **node_state)
if (node_state != NULL) if (node_state != NULL)
{ {
*node_state = palloc0(strlen(state) + 1); int state_len = strlen(state);
strncpy(*node_state, state, strlen(state)); *node_state = palloc0(state_len + 1);
strncpy(*node_state, state, state_len);
} }
if (strcmp(state, "streaming") != 0) if (strcmp(state, "streaming") != 0)