Skip to content

Commit

Permalink
Fix logic error
Browse files Browse the repository at this point in the history
Signed-off-by: David Crayford <DCrayford@rocketsoftware.com>
  • Loading branch information
daveyc committed Mar 6, 2020
1 parent cb4fb24 commit d8c933f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int indexOfString(const char *sourceString, size_t sourceLength, const char *sea
const char * currPos = sourceString + startPos;
const char * endPos = sourceString + sourceLength - searchLength;
char firstChar = searchString[0];
while (currPos < endPos) {
while (currPos <= endPos) {
size_t bytesRemaining = endPos - currPos + 1;
currPos = memchr(currPos, firstChar, bytesRemaining);
if (currPos == NULL) break;
Expand Down

0 comments on commit d8c933f

Please # to comment.