diff options
author | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-19 16:27:41 +0000 |
---|---|---|
committer | gepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-19 16:27:41 +0000 |
commit | 6fc8fc296c58e7a935fc6ee1d2775d02367edd95 (patch) | |
tree | 26b96b1ebbde9276b7b6d200377eb7b9a84ae61a /src/common/random.c | |
parent | c017009bbffa6a89ce55bb28387f00164538bfbc (diff) | |
download | hercules-6fc8fc296c58e7a935fc6ee1d2775d02367edd95.tar.gz hercules-6fc8fc296c58e7a935fc6ee1d2775d02367edd95.tar.bz2 hercules-6fc8fc296c58e7a935fc6ee1d2775d02367edd95.tar.xz hercules-6fc8fc296c58e7a935fc6ee1d2775d02367edd95.zip |
Changed `rnd()` to return signed number to avoid possible negative-signed to unsigned comparisons (caused by r15483, bugreport:5254).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15498 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/random.c')
-rw-r--r-- | src/common/random.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/random.c b/src/common/random.c index 39990f8a7..224b71fdb 100644 --- a/src/common/random.c +++ b/src/common/random.c @@ -43,10 +43,10 @@ void rnd_seed(uint32 seed) } -/// Generates a random number in the interval [0, UINT32_MAX] -uint32 rnd(void) +/// Generates a random number in the interval [0, SINT32_MAX] +int32 rnd(void) { - return (uint32)genrand_int32(); + return (int32)genrand_int31(); } |