safec
3.2
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "safe_str_lib.h"
Functions | |
EXPORT 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... | |
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 |