Exmirai Posted November 3, 2014 Share Posted November 3, 2014 code: menuDef_t *UI_CreateMenu(const char *name){ if (menuCount < MAX_MENUS) { menuDef_t *menu = &Menus[menuCount]; menu = (menuDef_t*)malloc(sizeof(menuDef_t)); Menu_Init(menu); menu->itemCount = 0; Q_strncpyz(menu->window.name, name, sizeof(menu->window.name)); menuCount++; return menu; } return NULL; } When I run this code, the game crashes with an error Q_Strncpyz: NULL dest, I understand the error, but can not understand exactly where I was wrong. What's the matter? spior likes this Link to comment
Solution Exmirai Posted November 8, 2014 Author Solution Share Posted November 8, 2014 Thank to spior for solving my problem Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now