mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-13 02:10:27 +00:00
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'
This commit is contained in:
parent
d48e440a72
commit
922540306e
@ -147,7 +147,7 @@ ngt_RandomStr( char *String, const size_t len)
|
|||||||
|
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
gettimeofday(&t, NULL);
|
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) {
|
for (size_t i = 0; i < len; ++i) {
|
||||||
String[i] = chars[rand() % (sizeof(chars) - 1)];
|
String[i] = chars[rand() % (sizeof(chars) - 1)];
|
||||||
|
Loading…
Reference in New Issue
Block a user