diff options
author | Zbigniew Chyla <zbigniew.chyla@nokia.com> | 2015-04-24 17:46:49 +0200 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-04-28 08:25:03 -0400 |
commit | d1965788249d7e22cdde4021d452cf0dc6c6b9bd (patch) | |
tree | f643affa49296021751ab98d1420c9d2a1edb16f /ntpshmread.c | |
parent | 9db980e35547d00c17064ab95ec0986bb2b86081 (diff) | |
download | gpsd-d1965788249d7e22cdde4021d452cf0dc6c6b9bd.tar.gz |
Copy structs using assignment, not memcpy().
Diffstat (limited to 'ntpshmread.c')
-rw-r--r-- | ntpshmread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ntpshmread.c b/ntpshmread.c index c75410be..498b78ee 100644 --- a/ntpshmread.c +++ b/ntpshmread.c @@ -85,7 +85,7 @@ enum segstat_t ntp_read(struct shmTime *shm_in, struct shm_stat_t *shm_stat, con * page size). */ memory_barrier(); - memcpy((void *)&shmcopy, (void *)shm, sizeof(struct shmTime)); + shmcopy = *shm; /* * An update consumer such as ntpd should zero the valid flag at this point. |