diff options
author | Stefan Bühler <stbuehler@web.de> | 2010-07-04 07:45:25 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2010-07-04 07:45:25 +0000 |
commit | a61e0bdde0514008669939efc41900f6badbec1d (patch) | |
tree | 890b7dfa5c50392083f78d2e24fcb60d014de434 | |
parent | bcb4f31188d0a294c5b2c745573e9dac8c8e591e (diff) | |
download | lighttpd-git-a61e0bdde0514008669939efc41900f6badbec1d.tar.gz |
Fix two compiler warnings
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2732 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/data_string.c | 2 | ||||
-rw-r--r-- | src/server.c | 4 |
3 files changed, 5 insertions, 2 deletions
@@ -15,6 +15,7 @@ NEWS * Include IP addresses on error log on password failures (fixes #2191) * Fix stalls while reading from ssl sockets (fixes #2197) * Fix etag formatting on boxes with 32-bit longs + * Fix two compiler warnings - 1.4.26 - 2010-02-07 * Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105) diff --git a/src/data_string.c b/src/data_string.c index f174cdc7..7648946c 100644 --- a/src/data_string.c +++ b/src/data_string.c @@ -69,8 +69,8 @@ static int data_response_insert_dup(data_unset *dst, data_unset *src) { static void data_string_print(const data_unset *d, int depth) { data_string *ds = (data_string *)d; + unsigned int i; UNUSED(depth); - unsigned int i = 0; /* empty and uninitialized strings */ if (ds->value->used < 1) { diff --git a/src/server.c b/src/server.c index 1bedd005..ec3222e5 100644 --- a/src/server.c +++ b/src/server.c @@ -213,7 +213,9 @@ static server *server_init(void) { if ((NULL != (frandom = fopen("/dev/urandom", "rb")) || NULL != (frandom = fopen("/dev/random", "rb"))) && 1 == fread(srv->entropy, sizeof(srv->entropy), 1, frandom)) { - srand(*(unsigned int*)srv->entropy); + unsigned int e; + memcpy(&e, srv->entropy, sizeof(e) < sizeof(srv->entropy) ? sizeof(e) : sizeof(srv->entropy)); + srand(e); srv->is_real_entropy = 1; } else { unsigned int j; |