Skip to content

Commit

Permalink
Fix logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
daveyc committed Mar 4, 2020
1 parent cb4fb24 commit 93914ad
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 93914ad

Please sign in to comment.