提交 d058b640 编写于 作者: Y yinjiaming

fix:打开LWIP_IPV6时有编译错误

更改了出错的参与算数运算的指针的数据类型
Signed-off-by: Nyinjiaming <yinjiaming@huawei.com>
Change-Id: I6891797cd1afa801faeecf1bfb891f0ac7db7f68
上级 4431b587
......@@ -125,7 +125,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
int squash_pos = ipv6_blocks;
int i;
const unsigned char *sc = (const unsigned char *)cp;
const char *ss = cp-1;
const unsigned char *ss = (const unsigned char *)(cp - 1);
for (; ; sc++) {
if (current_block_index >= ipv6_blocks) {
......@@ -142,7 +142,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
break;
} else if (*sc == ':') {
if (sc - ss == 1) {
if (sc != cp || sc[1] != ':') {
if (sc != (const unsigned char *)cp || sc[1] != ':') {
return 0; // address begins with a single ':' or contains ":::"
} // else address begins with one valid "::"
} else {
......@@ -163,7 +163,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
#if LWIP_IPV4
} else if (*sc == '.' && current_block_index < ipv6_blocks - 1) {
ip4_addr_t ip4;
int ret = ip4addr_aton(ss+1, &ip4);
int ret = ip4addr_aton((const char *)(ss + 1), &ip4);
if (!ret) {
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册