Fixed execKey generation
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Sat, 06 Aug 2011 12:56:43 -0700
changeset 5814 3c920707a142
parent 5813 3e8a444fefd3
child 5815 216d12fb365d
Fixed execKey generation
test/test-automation/src/libSDLtest/fuzzer/fuzzer.c
--- a/test/test-automation/src/libSDLtest/fuzzer/fuzzer.c	Sat Aug 06 21:53:22 2011 +0300
+++ b/test/test-automation/src/libSDLtest/fuzzer/fuzzer.c	Sat Aug 06 12:56:43 2011 -0700
@@ -79,25 +79,13 @@
 
 	MD5_CTX md5Context;
 	utl_md5Init(&md5Context);
-
 	utl_md5Update(&md5Context, buffer, entireString);
 	utl_md5Final(&md5Context);
 
 	SDL_free(buffer);
 
-	const char *execKey = md5Context.digest;
-
-	//printf("Debug: digest = %s\n", execKey);
-
-	// Casting fixes compiler warnings
-	Uint64 key = ((Uint64) execKey[8])  << 56 |
-					((Uint64) execKey[9])  << 48 |
-					((Uint64) execKey[10]) << 40 |
-					((Uint64) execKey[11]) << 32 |
-					((Uint64) execKey[12]) << 24 |
-					((Uint64) execKey[13]) << 16 |
-					((Uint64) execKey[14]) << 8  |
-					((Uint64) execKey[15]) << 0;
+	Uint64 *keys = (Uint64 *)md5Context.digest;
+	Uint64 key = keys[0];
 
 	return key;
 }
@@ -107,10 +95,6 @@
 {
 	Uint32 a = (execKey >> 32)  & 0x00000000FFFFFFFF;
 	Uint32 b = execKey & 0x00000000FFFFFFFF;
-
-	//printf("Debug: execKey: %llx\n", execKey);
-	//printf("Debug: a = %x - b = %x\n", a, b);
-
 	utl_randomInit(&rndContext, a, b);
 }