Aktualizovat "program.c
This commit is contained in:
parent
b6b1fe77f7
commit
7f03b44c66
@ -132,15 +132,16 @@ int search_string(const char* heap, const char* needle){
|
|||||||
int j;
|
int j;
|
||||||
|
|
||||||
/* For current index i, check for pattern match */
|
/* For current index i, check for pattern match */
|
||||||
for (j = 0; j <D; j++){
|
for (j = 0; j <= D; j++){
|
||||||
//printf("J=%d D=%d\n",j,D);
|
//printf("J=%d D=%d\n",j,D);
|
||||||
|
if(j==D){
|
||||||
|
//printf("Vraciam sa!");
|
||||||
|
return i;}
|
||||||
//printf("%c %c\n",needle_2[i + j],heap[j]);
|
//printf("%c %c\n",needle_2[i + j],heap[j]);
|
||||||
if (needle_2[i + j] != heap[j])
|
if (needle_2[i + j] != heap[j])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
if(j==D)return i;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user