mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-06 19:19:16 +00:00
Rename strnstr as it already exists in FreeBSD & OSX (with different argument ordering).
Arguably we could detect it but I couldn't be bothered dealing with auto*
This commit is contained in:
parent
0dee99dec2
commit
6d83fddbe5
@ -354,7 +354,7 @@ static void monitor_requests(struct sched_ent *alarm)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *strnstr(char *haystack, size_t haystack_len, const char *needle)
|
static char *srv_strnstr(char *haystack, size_t haystack_len, const char *needle)
|
||||||
{
|
{
|
||||||
size_t needle_len = strlen(needle);
|
size_t needle_len = strlen(needle);
|
||||||
for (; haystack_len >= needle_len; ++haystack, --haystack_len) {
|
for (; haystack_len >= needle_len; ++haystack, --haystack_len) {
|
||||||
@ -438,7 +438,7 @@ static void monitor_replies(struct sched_ent *alarm)
|
|||||||
char *readp = reply_bufend;
|
char *readp = reply_bufend;
|
||||||
reply_bufend += nread;
|
reply_bufend += nread;
|
||||||
char *nl;
|
char *nl;
|
||||||
while (nread > 0 && (nl = strnstr(readp, nread, "\n"))) {
|
while (nread > 0 && (nl = srv_strnstr(readp, nread, "\n"))) {
|
||||||
size_t len = nl - bufp + 1;
|
size_t len = nl - bufp + 1;
|
||||||
if (discarding_until_nl) {
|
if (discarding_until_nl) {
|
||||||
if (debug & DEBUG_DNAHELPER)
|
if (debug & DEBUG_DNAHELPER)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user