Hi Mark
The hdr are a struct of:
typedef struct tagAMX_HEADER {
int32_t size PACKED; /* size of the "file" */
uint16_t magic PACKED; /* signature */
char file_version; /* file format version */
char amx_version; /* required version of the AMX */
int16_t flags PACKED;
int16_t defsize PACKED; /* size of a definition record */
int32_t cod PACKED; /* initial value of COD - code block */
int32_t dat PACKED; /* initial value of DAT - data block */
int32_t hea PACKED; /* initial value of HEA - start of the heap */
int32_t stp PACKED; /* initial value of STP - stack top */
int32_t cip PACKED; /* initial value of CIP - the instruction pointer */
int32_t publics PACKED; /* offset to the "public functions" table */
int32_t natives PACKED; /* offset to the "native functions" table */
int32_t libraries PACKED; /* offset to the table of libraries */
int32_t pubvars PACKED; /* offset to the "public variables" table */
int32_t tags PACKED; /* offset to the "public tagnames" table */
int32_t nametable PACKED; /* offset to the name table */
int32_t overlays PACKED; /* offset to the overlay table */
} AMX_HEADER;
AMX_HEADER hdr;
memblock = malloc(hdr.stp);
When caling malloc(2536) I get the same result.
I think that it looks like the parameter not are passe allong when calling the malloc function.
But the reason for this do not understand.
The stdlib.h are includet in the config.h and i tried to include in the .c file aswell but with same result.
Regards
Steen