From: Clyne Sullivan Date: Sun, 18 Oct 2015 23:20:43 +0000 (-0400) Subject: fixed malloc crash X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=b692f5845d7d8293beda18db6e5bfed52549365a;p=clyne%2Fgamedev.git fixed malloc crash --- diff --git a/src/Quest.cpp b/src/Quest.cpp index 8aea006..2eed1ae 100644 --- a/src/Quest.cpp +++ b/src/Quest.cpp @@ -14,9 +14,21 @@ const Quest QuestList[TOTAL_QUESTS]={ }; +// Trust nobody +#define STRLEN_MIN 16 + +unsigned int safe_strlen(const char *s){ + unsigned int size=0; + while(s[size])size++; + if(size