Browse Source

Fixed bounds error.

release/0.19
JustinAJ 11 years ago
parent
commit
0f052fc011
  1. 8
      Jupiter/Readable_String_Imp.h
  2. BIN
      Release/Jupiter.lib

8
Jupiter/Readable_String_Imp.h

@ -713,11 +713,11 @@ template<typename T> bool Jupiter::Readable_String<T>::matchi(const T *format) c
template<typename T> unsigned int Jupiter::Readable_String<T>::wordCount(const T *whitespace) const template<typename T> unsigned int Jupiter::Readable_String<T>::wordCount(const T *whitespace) const
{ {
unsigned int result = 0; unsigned int result = 0;
const T *p = this->ptr(); size_t i = 0;
bool prev = true; bool prev = true;
while (*p != 0) while (i != this->size())
{ {
if (Jupiter::strpbrk<T>(whitespace, *p) == nullptr) // This isn't whitespace! if (Jupiter::strpbrk<T>(whitespace, this->get(i)) == nullptr) // This isn't whitespace!
{ {
if (prev == true) // We just left whitespace! if (prev == true) // We just left whitespace!
{ {
@ -726,7 +726,7 @@ template<typename T> unsigned int Jupiter::Readable_String<T>::wordCount(const T
} }
} }
else prev = true; // This is whitespace! else prev = true; // This is whitespace!
p++; i++;
} }
return result; return result;
} }

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save