rnd: Fix compiler warning
authorTobias Klauser <tklauser@distanz.ch>
Sun, 11 Aug 2013 13:24:21 +0000 (11 15:24 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Sun, 11 Aug 2013 13:24:21 +0000 (11 15:24 +0200)
Fix the following compiler warning that occurs when building with "-W
-Wall -Wextra":

rnd.c: In function â€˜randombytes_strong’:
rnd.c:50:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
rnd.c

diff --git a/rnd.c b/rnd.c
index bc72c97..8c123ab 100644 (file)
--- a/rnd.c
+++ b/rnd.c
@@ -47,7 +47,7 @@ static void randombytes_strong(unsigned char *x, size_t xlen)
        fds = open_or_die(HIG_ENTROPY_SOURCE, O_RDONLY);
 
        ret = read_exact(fds, x, xlen, 0);
-       if (ret != xlen)
+       if (ret != (int) xlen)
                panic("Error reading from entropy source!\n");
 
        close(fds);