This commit is contained in:
Oleksandr Vyshniakov 2025-09-25 22:08:50 +02:00
parent b1c99ee760
commit 0f9b5259b3
2 changed files with 4 additions and 4 deletions

Binary file not shown.

View File

@ -58,13 +58,13 @@ int search_string (const char* heap_orig, const char* needle_orig) {
int needle_len = strlen(needle);
for (int i = 0; i <= heap_len - needle_len; i++) {
int j;
for (j = 0; j < needle_len; j++) {
if (heap[i+j] != needle[j]) {
int o;
for (o = 0; o < needle_len; o++) {
if (heap[i+o] != needle[o]) {
break;
}
}
if (j == needle_len) {
if (o == needle_len) {
return i;
}
}