Lines Matching defs:destMax
26 #define SECUREC_STRCPY_PARAM_OK(strDest, destMax, strSrc) ((destMax) > 0 && \
27 (destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL && (strDest) != (strSrc))
264 SECUREC_INLINE errno_t CheckSrcRange(char *strDest, size_t destMax, const char *strSrc)
266 size_t tmpDestMax = destMax;
268 /* Use destMax as boundary checker and destMax must be greater than zero */
284 errno_t strcpy_error(char *strDest, size_t destMax, const char *strSrc)
286 if (destMax == 0 || destMax > SECUREC_STRING_MAX_LEN) {
298 return CheckSrcRange(strDest, destMax, strSrc);
311 * destMax Size of the destination string buffer.
319 * EINVAL strDest is NULL and destMax != 0 and destMax <= SECUREC_STRING_MAX_LEN
320 * EINVAL_AND_RESET strDest != NULL and strSrc is NULL and destMax != 0 and destMax <= SECUREC_STRING_MAX_LEN
321 * ERANGE destMax is 0 and destMax > SECUREC_STRING_MAX_LEN
325 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid
327 errno_t strcpy_s(char *strDest, size_t destMax, const char *strSrc)
329 if (SECUREC_STRCPY_PARAM_OK(strDest, destMax, strSrc)) {
331 SECUREC_CALC_STR_LEN(strSrc, destMax, &srcStrLen);
334 if (srcStrLen <= destMax) {
347 return strcpy_error(strDest, destMax, strSrc);