From 29a3747534d51716728276ea73565d6d3b4493a6 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sat, 16 Feb 2013 13:32:00 +0000 Subject: [PATCH] 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 --- dll/arcfour/arcfour.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/arcfour/arcfour.c b/dll/arcfour/arcfour.c index 7bc75fe..8f07371 100644 --- a/dll/arcfour/arcfour.c +++ b/dll/arcfour/arcfour.c @@ -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 */