Skip to content

Commit 6bcb1b8

Browse files
committed
fix: connect函数错误使用sizeof获取指针大小
1 parent 839dcab commit 6bcb1b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform/rtthread/platformNetwork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ RyanMqttError_e platformNetworkConnect(void *userData, platformNetwork_t *platfo
7272
goto __exit;
7373
}
7474

75-
if (0 != gethostbyname_r(host, &hostinfo, buf, sizeof(buf), &phost, &h_errnop))
75+
if (0 != gethostbyname_r(host, &hostinfo, buf, 384, &phost, &h_errnop))
7676
{
7777
rlog_w("平台可能不支持 gethostbyname_r 函数, 再次尝试使用 gethostbyname 获取域名信息");
7878

0 commit comments

Comments
 (0)