32 #include "safeclib_private.h" 33 #include "safe_str_constraint.h" 34 #include "safe_str_lib.h" 75 const char *src,
int *indicator)
77 const unsigned char *udest = (
const unsigned char *) dest;
78 const unsigned char *usrc = (
const unsigned char *) src;
80 if (indicator == NULL) {
83 return RCNEGATE(ESNULLP);
90 return RCNEGATE(ESNULLP);
96 return RCNEGATE(ESNULLP);
102 return RCNEGATE(ESZEROL);
105 if (dmax > RSIZE_MAX_STR) {
108 return RCNEGATE(ESLEMAX);
111 while (*udest && *usrc && dmax) {
113 if (toupper(*udest) != toupper(*usrc)) {
122 *indicator = (toupper(*udest) - toupper(*usrc));
123 return RCNEGATE(EOK);
void invoke_safe_str_constraint_handler(const char *msg, void *ptr, errno_t error)
Invokes the currently set constraint handler or the default.
errno_t strcasecmp_s(const char *dest, rsize_t dmax, const char *src, int *indicator)
Case insensitive string comparison by converting to uppercase prior to the compare.