diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2013-04-02 13:55:28 -0400 |
---|---|---|
committer | Ian Stakenvicius <axs@gentoo.org> | 2013-04-02 14:36:31 -0400 |
commit | c7c0dad3bdc11f3e75c5ae7c407b93e9bffcca04 (patch) | |
tree | c7517e3652bd6270f9a4f7385fe58cf80f9a672e /src/libudev/libudev-util.c | |
parent | dfdffb704101fe44a216c10bdf94e46443fdbcc6 (diff) |
libudev: update to 199
This updates the library codebase to upstream version 199.
(originally merged by Anthony G. Basile <blueness@gentoo.org>)
Upstream commits 5ae18ddc0d and 53726349e1 are not applied,
code will be excluded via #if...#endif in a future commit
Authors:
Kay Sievers
Thomas Hindoe Paaboel Andersen
Hannes Reinecke
Jan Engelhardt
See http://cgit.freedesktop.org/systemd/systemd/log/src/libudev
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Diffstat (limited to 'src/libudev/libudev-util.c')
-rw-r--r-- | src/libudev/libudev-util.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index 0ca86c815d..ac906bfec4 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -670,17 +670,18 @@ static unsigned int murmur_hash2(const char *key, int len, unsigned int seed) /* mix 4 bytes at a time into the hash */ const unsigned char * data = (const unsigned char *)key; - while(len >= 4) { - unsigned int k = *(unsigned int *)data; + while(len >= sizeof(unsigned int)) { + unsigned int k; + memcpy(&k, data, sizeof(k)); k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; - data += 4; - len -= 4; + data += sizeof(k); + len -= sizeof(k); } /* handle the last few bytes of the input array */ |