Skip to main content

Name

strnstrn — Find a binary substring within a binary string

Synopsis

#include "util.h"

| const char * **strnstrn** ( | needle, |   | |   | needle_len, |   | |   | haystack, |   | |   | haystack_len); |   |

const char * <var class="pdparam">needle</var>; int <var class="pdparam">needle_len</var>; const char * <var class="pdparam">haystack</var>; int <var class="pdparam">haystack_len</var>;

Description

Find a binary substring within a binary string.

Search for needle in haystack. NUL characters in the strings are ignored; only the lengths are respected.

Parameters

needle

The string to find.

needle_len

The length of the needle.

haystack

The string to search.

haystack_len

The length of the haystack.

Return Values

Returns a pointer to the first instance of needle found in haystack.

Threading

It is legal to call this function in the Scheduler thread.

Was this page helpful?