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.
This commit is contained in:
Ryan C. Gordon 2016-04-09 01:03:44 -04:00
parent 1f1291d2bc
commit 284f6c63ca

View File

@ -64,7 +64,7 @@ static void GetGUID(UBYTE aub[16])
#else #else
// !!! FIXME : rcg10112001 Is this sufficient for these purposes? // !!! 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)); aub[i] = (UBYTE) (255.0 * rand() / (RAND_MAX + 1.0));
#endif #endif