From 284f6c63ca635a6c6f0c0167593c9a760af762d7 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 9 Apr 2016 01:03:44 -0400 Subject: [PATCH] Fixed a sizeof bug. If you have... void myfunc(char buf[16]) { printf("%d\n", (int) sizeof (buf)); } ...this will print sizeof (char *) instead of 16, so this fixes a piece of code that assumed the latter instead of the former. --- Sources/Engine/Entities/PlayerCharacter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Engine/Entities/PlayerCharacter.cpp b/Sources/Engine/Entities/PlayerCharacter.cpp index a1369c6..53ad96c 100644 --- a/Sources/Engine/Entities/PlayerCharacter.cpp +++ b/Sources/Engine/Entities/PlayerCharacter.cpp @@ -64,7 +64,7 @@ static void GetGUID(UBYTE aub[16]) #else // !!! FIXME : rcg10112001 Is this sufficient for these purposes? - for (int i = 0; i < sizeof (aub) / sizeof (aub[0]); i++) + for (int i = 0; i < 16; i++) aub[i] = (UBYTE) (255.0 * rand() / (RAND_MAX + 1.0)); #endif