Fix 1 byte searching in BinSearch function.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 9b7ee312e3
commit 08ae4482a2

@ -49,6 +49,10 @@ BinSearch(const u_int8_t *haystack, size_t haystack_len,
if (*haystack != *n) {
continue;
}
/* one byte needles */
if (needle_len == 1)
return haystack;
for (h = haystack+1, n++; h != hmax; h++, n++) {
//printf("h %c n %c\n", isprint(*h) ? *h : 'X', *n);
if (*h != *n) {

Loading…
Cancel
Save