Fix sequence point issue in arcfour (S[x] = --x; is undefined).

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@228 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2013-02-16 13:32:00 +00:00
parent 1390402af1
commit 29a3747534

View File

@@ -93,7 +93,7 @@ static inline void arcfourInit(arckey *arc, char *userkey, unsigned short len)
/* Seed the S-box linearly, then mix in the key while stiring briskly */
arc->i = arc->j = 0; /* Initialize i and j to 0 */
while((S[x] = --x)); /* Initialize S-box, backwards */
while(--x, (S[x] = x)); /* Initialize S-box, backwards */
/* Note: Some of these optimizations REQUIRE arcword to be 8-bit unsigned */
do { /* Spread user key into real key */