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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/protocols/qq
From:       Michael Pyne <mpyne () kde ! org>
Date:       2013-03-16 14:59:19
Message-ID: 20130316145919.D2692AC876 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1344782 by mpyne:

Remove warning about memset with constant zero-length.

I'm not sure how to verify whether the position pointer is supposed to
increment in this case or not, so I have copied the old behavior exactly,
except for trying to call memset when the length is 0.


 M  +3 -1      evautil.cpp  


--- trunk/KDE/kdenetwork/kopete/protocols/qq/evautil.cpp #1344781:1344782
@@ -78,7 +78,9 @@
 		plain[0] = ( rand() & 0xf8 ) | pos;
 		memset( plain_pre, 0, 8 );
 		memset( crypted_pre, 0, 8 );
-		memset( plain+1, rand()& 0xff, pos++ );
+		if( pos > 0 )
+			memset( plain+1, rand()& 0xff, pos );
+		pos++;
 
 		// pad 2 bytes
 		for( i = 0; i< 2; i++ )
[prev in list] [next in list] [prev in thread] [next in thread] 

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