View Single Post
  #2  
Old 12-02-2008, 02:58 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by cybernine186 View Post
Code:
    char* itemdupemsg = NULL;
    sprintf(itemdupemsg, "Loot Item Duplication {%i}", item);
That'll cause a crash. You either want to declare itemdupemsg as a fixed size char array, e.g.

Code:
    char itemdupemsg[150];
Or use MakeAnyLenString:

Code:
    char *itemdupemsg = NULL;
    MakeAnyLenString(&itemdupemsg,  "Loot Item Duplication {%s}", item->Name);
    database.SetMQDetectionFlag(...
    safe_delete_array(itemdupemsg);
Reply With Quote