libcurl private function Curl_memrchr() now in curl_memrchr.c and curl_memrchr.h
This commit is contained in:
18
lib/cookie.c
18
lib/cookie.c
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user