mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:33:33 +03:00
libcurl private function Curl_memrchr() now in curl_memrchr.c and curl_memrchr.h
This commit is contained in:
parent
b64dd3c63d
commit
7d22ce5573
10 changed files with 134 additions and 24 deletions
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue