safec
2.1
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safeclib_private.h"
#include "safe_str_constraint.h"
#include "safe_str_lib.h"
Go to the source code of this file.
Functions | |
errno_t | strprefix_s (const char *dest, rsize_t dmax, const char *src) |
Determines if the prefix pointed to by src is at the beginning of string pointed to by dest. More... | |
errno_t strprefix_s | ( | const char * | dest, |
rsize_t | dmax, | ||
const char * | src | ||
) |
Determines if the prefix pointed to by src is at the beginning of string pointed to by dest.
The prefix must be a complete match in dest. Useful for command or user input parsing. The scanning stops at the first null in dest or src, or after dmax characters.
dest | pointer to string to compare against |
dmax | restricted maximum length of dest |
src | pointer to the prefix |
EOK | when successful operation, substring found. |
ESNULLP | when dest/src/substring is NULL pointer |
ESZEROL | when dmax/slen = 0 |
ESLEMAX | when dmax/slen > RSIZE_MAX_STR |
ESNOTFND | when prefix not found in dest |
Definition at line 70 of file strprefix_s.c.