fix the indentation and assert [#338]

This commit is contained in:
Sukchan Lee 2019-12-27 23:22:16 +09:00
parent 768e4d9eb3
commit 5664b90e38
1 changed files with 4 additions and 3 deletions

View File

@ -1300,17 +1300,18 @@ static int flow_rx_to_gx(ogs_flow_t *rx_flow, ogs_flow_t *gx_flow)
gx_flow->description = ogs_malloc(len);
strcpy(gx_flow->description, "permit out");
from_str = strstr(&rx_flow->description[strlen("permit in")], "from");
ogs_assert(from_str);
to_str = strstr(&rx_flow->description[strlen("permit in")], "to");
ogs_assert(to_str);
strncat(gx_flow->description,
&rx_flow->description[strlen("permit in")],
strlen(rx_flow->description) - strlen("permit in") - strlen(from_str));
strlen(rx_flow->description) -
strlen("permit in") - strlen(from_str));
strcat(gx_flow->description, "from");
strcat(gx_flow->description, &to_str[strlen("to")]);
strcat(gx_flow->description, " to");
strncat(gx_flow->description, &from_str[strlen("from")],
strlen(from_str) - strlen(to_str) - strlen("from") - 1);
// strcat(gx_flow->description,
// &rx_flow->description[strlen("permit in")]);
ogs_assert(len == strlen(gx_flow->description)+1);
} else {
ogs_error("Invalid Flow Descripton : [%s]", rx_flow->description);