Skip to content

Commit

Permalink
""
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Lightfoot committed Jul 2, 2002
1 parent f77cce9 commit 54be3da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
7 changes: 6 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changelog for driftnet
$Id: CHANGES,v 1.13 2002/06/13 20:07:31 chris Exp $
$Id: CHANGES,v 1.14 2002/07/02 22:17:25 chris Exp $

0.1.6

Chagned the algorithm used to search for image start blocks to Boyer-Moore, for
a performance improvement.

0.1.5

Expand Down
21 changes: 1 addition & 20 deletions image.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,12 @@
*
*/

static const char rcsid[] = "$Id: image.c,v 1.9 2002/07/02 21:41:19 chris Exp $";
static const char rcsid[] = "$Id: image.c,v 1.10 2002/07/02 22:17:25 chris Exp $";

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#if 0
static char *memstr(const char *haystack, size_t h_len, const char *needle, size_t n_len) {
const char *p;

if (n_len > h_len)
return NULL;

p = (const char*) memchr(haystack, *needle, h_len - n_len + 1);
while (p) {
if (!memcmp(p, needle, n_len))
return (char*)p;
else
p = (const char*)memchr(p + 1, *needle, h_len - n_len - (p - haystack));
}

return NULL;
}
#endif

/* memstr:
* Locate needle, of length n_len, in haystack, of length h_len, returning NULL.
* Uses the Boyer-Moore search algorithm. Cf.
Expand Down

0 comments on commit 54be3da

Please sign in to comment.