diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-04-12 08:03:03 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-04-12 08:03:03 -0600 |
commit | b315074b5c8fe058fdab4e163939b6402b58deff (patch) | |
tree | 7048a0823c21d94fb4317d8545fee49f96a7013d /apps/netutils | |
parent | b3d8e1f56be6e6b3c82a484cf0f71c240537d4bc (diff) | |
download | nuttx-b315074b5c8fe058fdab4e163939b6402b58deff.tar.gz nuttx-b315074b5c8fe058fdab4e163939b6402b58deff.tar.bz2 nuttx-b315074b5c8fe058fdab4e163939b6402b58deff.zip |
Corrections to the NTP client from Manuel Stuehn
Diffstat (limited to 'apps/netutils')
-rw-r--r-- | apps/netutils/ntpclient/ntpclient.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/netutils/ntpclient/ntpclient.c b/apps/netutils/ntpclient/ntpclient.c index 3878f02f2..d27e4b2a5 100644 --- a/apps/netutils/ntpclient/ntpclient.c +++ b/apps/netutils/ntpclient/ntpclient.c @@ -114,10 +114,10 @@ static inline uint32_t ntpc_getuint32(FAR uint8_t *ptr) { /* Network order is big-endian; host order is irrelevant */ - return (uint32_t)ptr[0] | /* LS byte appears first in data stream */ - ((uint32_t)ptr[1] << 8) | - ((uint32_t)ptr[2] << 16) | - ((uint32_t)ptr[3] << 24); + return (uint32_t)ptr[3] | /* MS byte appears first in data stream */ + ((uint32_t)ptr[2] << 8) | + ((uint32_t)ptr[1] << 16) | + ((uint32_t)ptr[0] << 24); } /**************************************************************************** @@ -347,7 +347,7 @@ static int ntpc_daemon(int argc, char **argv) */ sched_lock(); - while (g_ntpc_daemon.state == NTP_STOP_REQUESTED) + while (g_ntpc_daemon.state != NTP_STOP_REQUESTED) { /* Format the transmit datagram */ @@ -394,7 +394,7 @@ static int ntpc_daemon(int argc, char **argv) * datagram. */ - if (nbytes >= NTP_DATAGRAM_MINSIZE) + if (nbytes >= (ssize_t)NTP_DATAGRAM_MINSIZE) { svdbg("Setting time\n"); ntpc_settime(recv.recvtimestamp); |