fix fct when called with a one byte array
This commit is contained in:
1 parent
c3e29789a9
commit
7414cdf359
2 files changed
+5
-1
No files matched your search
@@ -1563,6 +1563,10 @@ int byte_strstr(const uint8_t *src, size_t srclen, const uint8_t *pattern, size_
|
||||
continue;
|
||||
}
|
||||
|
||||
if (plen == 1) {
|
||||
return i;
|
||||
}
|
||||
|
||||
// try to match rest of the pattern
|
||||
for (int j = plen - 1; j >= 1; j--) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user