libcurl private function Curl_memrchr() now in curl_memrchr.c and curl_memrchr.h

This commit is contained in:
Yang Tse
2009-09-28 16:05:20 +00:00
parent b64dd3c63d
commit 7d22ce5573
10 changed files with 134 additions and 24 deletions

View File

@@ -97,6 +97,7 @@ Example set of cookies:
#include "share.h"
#include "strtoofft.h"
#include "rawstr.h"
#include "curl_memrchr.h"
/* The last #include file should be: */
#include "memdebug.h"
@@ -168,23 +169,6 @@ static void strstore(char **str, const char *newstr)
}
/*
* The memrchr() function is like the memchr() function, except that it
* searches backwards from the end of the n bytes pointed to by s instead of
* forwards from the front.
*
* Exists in glibc but is not widely available on other systems.
*/
static void *memrchr(const char *s, int c, size_t n)
{
while(n--) {
if(s[n] == c)
return &s[n];
}
return NULL;
}
/****************************************************************************
*
* Curl_cookie_add()