safec  3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
strcmpfld_s.c File Reference
#include "safe_str_lib.h"
+ Include dependency graph for strcmpfld_s.c:

Functions

EXPORT errno_t strcmpfld_s (const char *dest, rsize_t dmax, const char *src, int *indicator)
 Compares the character array pointed to by src to the character array pointed to by dest for dmax characters. More...
 

Function Documentation

◆ strcmpfld_s()

EXPORT errno_t strcmpfld_s ( const char *  dest,
rsize_t  dmax,
const char *  src,
int *  indicator 
)

Compares the character array pointed to by src to the character array pointed to by dest for dmax characters.

The null terminator does not stop the comparison.

Remarks
EXTENSION TO ISO/IEC TR 24731, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
Parameters
[in]destpointer to string to compare against
[in]dmaxrestricted maximum length of string dest
[in]srcpointer to the string to be compared to dest
[out]indicatorpointer to result indicator, greater than 0, equal to 0 or less than 0, if the string pointed to by dest is greater than, equal to or less than the string pointed to by src respectively.
Precondition
Neither dest nor src shall be a null pointer.
indicator shall not be a null pointer.
dmax shall not be 0
dmax shall not be greater than RSIZE_MAX_STR
Returns
indicator (when the return code is OK)
Return values
>0when dest greater than src
0when strings the same
<0when dest less than src
EOKwhen comparison is complete
ESNULLPwhen dest/src/indicator is NULL pointer
ESZEROLwhen dmax = 0
ESLEMAXwhen dmax > RSIZE_MAX_STR
See also
strcpyfld_s(), strcpyfldin_s(), strcpyfldout_s()