Lines Matching refs:strSrc
23 #define SECUREC_STRNCPY_PARAM_OK(strDest, destMax, strSrc, count) \
24 (((destMax) > 0 && (destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL && \
27 #define SECUREC_STRNCPY_PARAM_OK(strDest, destMax, strSrc, count) \
28 (((destMax) > 0 && (destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL && \
35 SECUREC_INLINE errno_t CheckSrcCountRange(char *strDest, size_t destMax, const char *strSrc, size_t count)
39 const char *endPos = strSrc;
58 errno_t strncpy_error(char *strDest, size_t destMax, const char *strSrc, size_t count)
64 if (strDest == NULL || strSrc == NULL) {
81 return CheckSrcCountRange(strDest, destMax, strSrc, count);
87 * from the array pointed to by strSrc to the array pointed to by strDest.
92 * strSrc Source string.
101 * EINVAL_AND_RESET strDest != NULL and strSrc is NULL and destMax != 0 and destMax <= SECUREC_STRING_MAX_LEN
108 errno_t strncpy_s(char *strDest, size_t destMax, const char *strSrc, size_t count)
110 if (SECUREC_STRNCPY_PARAM_OK(strDest, destMax, strSrc, count)) {
113 SECUREC_CALC_STR_LEN(strSrc, count, &minCpLen); /* No ending terminator */
121 SECUREC_CALC_STR_LEN(strSrc, tmpCount, &minCpLen); /* No ending terminator */
128 if (SECUREC_STRING_NO_OVERLAP(strDest, strSrc, minCpLen) || strDest == strSrc) {
130 SECUREC_MEMCPY_WARP_OPT(strDest, strSrc, minCpLen); /* Copy string without terminator */
139 return strncpy_error(strDest, destMax, strSrc, count);