[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-protocol-cvs
Subject:    [Protocol-cvs] common/util hxcloakedsocket.cpp,1.8,1.9
From:       seansmith () helixcommunity ! org
Date:       2005-04-29 21:06:16
[Download RAW message or body]

Update of /cvsroot/protocol/common/util
In directory cvs-new:/tmp/cvs-serv17848

Modified Files:
	hxcloakedsocket.cpp 
Log Message:
Description: Fixed logic error in RandBetween() function.
CR: atin, ping
Branches: head, hxclient_1_5_0_cayenne


Index: hxcloakedsocket.cpp
===================================================================
RCS file: /cvsroot/protocol/common/util/hxcloakedsocket.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- hxcloakedsocket.cpp	10 Mar 2005 20:59:16 -0000	1.8
+++ hxcloakedsocket.cpp	29 Apr 2005 21:06:13 -0000	1.9
@@ -215,7 +215,7 @@
 //Return a random number in [beg, int].
 static inline int RandBetween(int beg, int end )
 {
-    return beg + ((end-beg+1)*rand())/RAND_MAX;
+    return beg + rand()%(end-beg+1);
 }
 
 static inline void _CreateRandomString(CHXString& str )



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic