summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJiaojinxing <jiaojinxing1987@gmail.com>2016-12-09 11:49:10 (GMT)
committer Jiaojinxing <jiaojinxing1987@gmail.com>2016-12-09 11:49:10 (GMT)
commit3c9834357a30cbcd306f5638a9993b63e5683004 (patch)
tree9aeebd6f49e3b5d2629122335ee298f43574d2d8
parent3c9191a63d054e8c7892e51157719af85fa91375 (diff)
downloadsntp-master.zip
sntp-master.tar.gz
sntp-master.tar.bz2
Fixed connect failure bug.HEADmaster
-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");
}