Skip to content

Commit

Permalink
Add missing type cast in TfwStr: void pointer arithmetics has undefin…
Browse files Browse the repository at this point in the history
…ed behaviour
  • Loading branch information
vankoven committed Dec 17, 2018
1 parent 966ebfa commit ab8400a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tempesta_fw/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tfw_addr_pton_v4(const TfwStr *s, TfwAddr *addr)

TFW_STR_FOR_EACH_CHUNK(c, s, end) {
for (k = 0; k != c->len; ++k) {
p = c->ptr + k;
p = (char *)c->ptr + k;
if (isdigit(*p)) {
octet = (octet == -1)
? *p - '0'
Expand Down Expand Up @@ -101,7 +101,7 @@ tfw_addr_pton_v6(const TfwStr *s, TfwAddr *addr)

TFW_STR_FOR_EACH_CHUNK(c, s, end) {
for (k = 0; k != c->len; ++k) {
p = c->ptr + k;
p = (char *)c->ptr + k;
if (i > 7 && !(i == 8 && port == 1))
return -EINVAL;

Expand Down Expand Up @@ -249,7 +249,7 @@ tfw_addr_pton(const TfwStr *str, TfwAddr *addr)
TFW_STR_FOR_EACH_CHUNK(c, str, end) {
int i;
for (i = 0; i != c->len; ++i) {
pos = c->ptr + i;
pos = (char *)c->ptr + i;
if (!isdigit(*pos))
goto delim;
}
Expand Down

0 comments on commit ab8400a

Please sign in to comment.