~ubuntu-branches/ubuntu/lucid/bogofilter/lucid-updates

« back to all changes in this revision

Viewing changes to src/memstr.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-05-06 05:41:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090506054152-tgameecssbuv4np6
Tags: 1.2.0-2ubuntu1
* Merge from debian unstable, remaining changes: LP: #372497
  - don't build qdbm.
  - Don't build tokyocabinet support as it's in universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: memstr.c 5314 2005-01-09 04:24:21Z m-a $ */
 
1
/* $Id: memstr.c 6774 2009-02-01 02:29:27Z relson $ */
2
2
 
3
3
/** \file memstr.c
4
4
 * find a C string in memory
12
12
/** find the C string \a needle in the \a n bytes starting with \a hay,
13
13
 * \return 0 if no match found, the pointer to the first byte otherwise.
14
14
 */
15
 
void *memstr(const void *hay, size_t n, const char *needle)
 
15
void *memstr(void *hay, size_t n, const char *needle)
16
16
{
17
 
    unsigned const char *haystack = hay;
 
17
    unsigned char *haystack = hay;
18
18
    size_t l = strlen(needle);
19
19
 
20
20
    while (n >= l) {