Reply to Re: New D-Mod: Cursed Blades Part 1: Charlie's Legacy
If you don't have an account, just leave the password field blank.
July 26th 2022, 04:04 PM
ghostknight
/* store current procedure arguments expanded values of type 'int' (see get_parms) */ static long nlist[10];
Change long to int! A long takes up 8 bytes on a Linux 64bit system and an int uses 4 bytes. Thus, the entire array takes up 80 bytes. However, the code here
/* Clean-up parameters */ memset(nlist, 0, 10 * sizeof (int));
Only cleans up 40 bytes (10 * sizeof(int) = 10 * 4 = 40). So the last 5 elements of the array never get cleared. This is what robj observed when he suggested that only explicitly passing '0' in a function may "fix" it.
In conclusion, robj's dmod is NOT to blame.