From: Alexander Barton Date: Sat, 18 Aug 2012 10:34:11 +0000 (+0200) Subject: ngt_RandomStr(): Add implicit cast to "unsigned". X-Git-Tag: rel-20-rc1~113 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=commitdiff_plain;h=922540306e968b3c64150e771d0773273535b661;hp=d48e440a722cb56fd3c2996d2d3c87ce7f471042 ngt_RandomStr(): Add implicit cast to "unsigned". This fixes the following warning of Xcode 4.5: src/tool/tool.c:150:19: Implicit conversion loses integer precision: 'long' to 'unsigned int' --- diff --git a/src/tool/tool.c b/src/tool/tool.c index 31c6fb41..df109188 100644 --- a/src/tool/tool.c +++ b/src/tool/tool.c @@ -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)];