Lines Matching refs:dst
56 /* Figure out if [dst .. dst+dstlen-1] overlaps with
64 Bool is_overlap ( void* dst, const void* src, SizeT dstlen, SizeT srclen )
72 loD = (Addr)dst;
92 #define RECORD_OVERLAP_ERROR(s, src, dst, len) \
97 s, src, dst, len, 0); \
156 char* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( char* dst, const char* src ); \
157 char* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( char* dst, const char* src ) \
160 Char* dst_orig = dst; \
161 while (*dst) dst++; \
162 while (*src) *dst++ = *src++; \
163 *dst = 0; \
169 (Addr)dst-(Addr)dst_orig+1, \
183 ( char* dst, const char* src, SizeT n ); \
185 ( char* dst, const char* src, SizeT n ) \
188 Char* dst_orig = dst; \
191 while (*dst) dst++; \
192 while (m < n && *src) { m++; *dst++ = *src++; } /* concat <= n chars */ \
193 *dst = 0; /* always add null */ \
199 (Addr)dst-(Addr)dst_orig+1, \
212 /* Append src to dst. n is the size of dst's buffer. dst is guaranteed
219 ( char* dst, const char* src, SizeT n ); \
221 ( char* dst, const char* src, SizeT n ) \
224 Char* dst_orig = dst; \
227 while (m < n && *dst) { m++; dst++; } \
230 while (m < n-1 && *src) { m++; *dst++ = *src++; } \
231 *dst = 0; \
233 /* No space to copy anything to dst. m == n */ \
241 (Addr)dst-(Addr)dst_orig+1, \
291 char* VG_REPLACE_FUNCTION_ZU(soname, fnname) ( char* dst, const char* src ); \
292 char* VG_REPLACE_FUNCTION_ZU(soname, fnname) ( char* dst, const char* src ) \
295 Char* dst_orig = dst; \
297 while (*src) *dst++ = *src++; \
298 *dst = 0; \
304 (Addr)dst-(Addr)dst_orig+1, \
321 ( char* dst, const char* src, SizeT n ); \
323 ( char* dst, const char* src, SizeT n ) \
326 Char* dst_orig = dst; \
329 while (m < n && *src) { m++; *dst++ = *src++; } \
330 /* Check for overlap after copying; all n bytes of dst are relevant, */ \
333 RECORD_OVERLAP_ERROR("strncpy", dst, src, n); \
334 while (m++ < n) *dst++ = 0; /* must pad remainder with nulls */ \
347 /* Copy up to n-1 bytes from src to dst. Then nul-terminate dst if n > 0.
348 Returns strlen(src). Does not zero-fill the remainder of dst. */
351 ( char* dst, const char* src, SizeT n ); \
353 ( char* dst, const char* src, SizeT n ) \
356 char* dst_orig = dst; \
359 while (m < n-1 && *src) { m++; *dst++ = *src++; } \
361 /* Check for overlap after copying; all n bytes of dst are relevant, */ \
364 RECORD_OVERLAP_ERROR("strlcpy", dst, src, n); \
365 /* Nul-terminate dst. */ \
366 if (n > 0) *dst = 0; \
566 ( void *dst, const void *src, SizeT len ); \
568 ( void *dst, const void *src, SizeT len ) \
570 if (is_overlap(dst, src, len, len)) \
571 RECORD_OVERLAP_ERROR("memcpy", dst, src, len); \
576 if (dst < src) { \
580 Addr d = (Addr)dst; \
592 return dst; \
603 } else if (dst > src) { \
606 Addr d = ((Addr)dst) + n; \
619 return dst; \
632 return dst; \
691 char* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( char* dst, const char* src ); \
692 char* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( char* dst, const char* src ) \
695 Char* dst_orig = dst; \
697 while (*src) *dst++ = *src++; \
698 *dst = 0; \
704 (Addr)dst-(Addr)dst_orig+1, \
708 return dst; \
751 Char* dst = (Char*)dstV; \
753 if (dst < src) { \
755 dst[i] = src[i]; \
758 if (dst > src) { \
760 dst[n-i-1] = src[n-i-1]; \
762 return dst; \
778 Char* dst = (Char*)dstV; \
780 if (dst < src) { \
782 dst[i] = src[i]; \
785 if (dst > src) { \
787 dst[n-i-1] = src[n-i-1]; \
807 Char* dst = (Char*)dstV; \
811 if (dst < src) { \
813 dst[i] = src[i]; \
816 if (dst > src) { \
818 dst[n-i-1] = src[n-i-1]; \
820 return dst; \
872 (char* dst, const char* src, SizeT len); \
874 (char* dst, const char* src, SizeT len) \
877 char* ret = dst; \
880 while ((*dst++ = *src++) != '\0') \
900 (char* dst, const char* src, SizeT len); \
902 (char* dst, const char* src, SizeT len) \
907 while ((*dst++ = *src++) != '\0') \
910 return dst - 1; \
926 ( void *dst, const void *src, SizeT len ); \
928 ( void *dst, const void *src, SizeT len ) \
935 return dst; \
937 if (is_overlap(dst, src, len, len)) \
938 RECORD_OVERLAP_ERROR("mempcpy", dst, src, len); \
940 if ( dst > src ) { \
941 d = (char *)dst + len - 1; \
946 } else if ( dst < src ) { \
947 d = (char *)dst; \
953 return (void*)( ((char*)dst) + len_saved ); \
964 (void* dst, const void* src, SizeT len, SizeT dstlen ); \
966 (void* dst, const void* src, SizeT len, SizeT dstlen ) \
975 return dst; \
977 if (is_overlap(dst, src, len, len)) \
978 RECORD_OVERLAP_ERROR("memcpy_chk", dst, src, len); \
980 if ( dst > src ) { \
981 d = (char *)dst + len - 1; \
986 } else if ( dst < src ) { \
987 d = (char *)dst; \
993 return dst; \