From b692f5845d7d8293beda18db6e5bfed52549365a Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 18 Oct 2015 19:20:43 -0400 Subject: fixed malloc crash --- src/Quest.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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