From c1c52692d19af30e936ab6ce028de39f842f6dfb Mon Sep 17 00:00:00 2001 From: JustinAJ Date: Fri, 6 Jun 2014 18:48:18 -0400 Subject: [PATCH] Added missing length checks --- Jupiter/Functions.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jupiter/Functions.c b/Jupiter/Functions.c index 33dee5a..5174362 100644 --- a/Jupiter/Functions.c +++ b/Jupiter/Functions.c @@ -703,7 +703,7 @@ double Jupiter_strtod_nospace(const char *str) int strtoi_s(const char *str, size_t length, int base) { - while (isspace(*str)) + while (length != 0 && isspace(*str)) { str++; length--; @@ -713,7 +713,7 @@ int strtoi_s(const char *str, size_t length, int base) unsigned int strtoui_s(const char *str, size_t length, int base) { - while (isspace(*str)) + while (length != 0 && isspace(*str)) { str++; length--; @@ -723,7 +723,7 @@ unsigned int strtoui_s(const char *str, size_t length, int base) double Jupiter_strtod_s(const char *str, size_t length) { - while (isspace(*str)) + while (length != 0 && isspace(*str)) { str++; length--;