Better fix which follows http://stackoverflow.com/questions/1...h-file-scope-c
PHP Code:#define MAX_WEAPON_IGNORE_SIZE 20
#define MAX_WEAPON_NAME_SIZE 32
char* defaultweapon_mp;
char ignoredWeapons[MAX_WEAPON_IGNORE_SIZE][MAX_WEAPON_NAME_SIZE];
int ignoredWeaponCount = 0;
void gsc_utils_init() {
if(defaultweapon_mp == NULL)
defaultweapon_mp = (char*)malloc(sizeof(char) * MAX_WEAPON_NAME_SIZE);
if(defaultweapon_mp == NULL)
printf("Failed to malloc defaultweapon_mp\n");
strcpy(defaultweapon_mp, (char*)"defaultweapon_mp");
defaultweapon_mp[strlen(defaultweapon_mp)] = '\0';
}
void gsc_utils_free() {
free(defaultweapon_mp);
}



Reply With Quote