summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
-rw-r--r--src/sntp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sntp.c b/src/sntp.c
index 7d6d022..71d8950 100644
--- a/src/sntp.c
+++ b/src/sntp.c
@@ -207,7 +207,7 @@ static INT sntpConnect (INT iSockfd, PCHAR pcHostName, PCHAR pcPort)
}
if (connect(iSockfd, (struct sockaddr *)aiResult->ai_addr,
- aiResult->ai_addrlen) == SNTP_PX_ERR) { /* 连接服务器 */
+ sizeof(struct sockaddr_in)) == SNTP_PX_ERR) { /* 连接服务器 */
if (SNTP_CONTAIN(ucSntpHandleCmd, SNTP_CMD_DEBUG)) {
SNTP_LOGHANDLE_F(cSntpLogFileName, "connect error.\n");
}