]> granicus.if.org Git - ngircd/commitdiff
ngt_RandomStr(): Add implicit cast to "unsigned".
authorAlexander Barton <alex@barton.de>
Sat, 18 Aug 2012 10:34:11 +0000 (12:34 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 18 Aug 2012 10:34:11 +0000 (12:34 +0200)
This fixes the following warning of Xcode 4.5:

 src/tool/tool.c:150:19:
  Implicit conversion loses integer precision: 'long' to 'unsigned int'

src/tool/tool.c

index 31c6fb41fb9272f5b4abd5e6713b12d359fb5387..df10918893348a4a1ef4205938e00db49eddb6b7 100644 (file)
@@ -147,7 +147,7 @@ ngt_RandomStr( char *String, const size_t len)
 
        struct timeval t;
        gettimeofday(&t, NULL);
-       srand(t.tv_usec * t.tv_sec);
+       srand((unsigned)(t.tv_usec * t.tv_sec));
 
        for (size_t i = 0; i < len; ++i) {
                String[i] = chars[rand() % (sizeof(chars) - 1)];