summaryrefslogtreecommitdiff
path: root/ldso/include/dl-string.h
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/include/dl-string.h')
-rw-r--r--ldso/include/dl-string.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h
index 0b313e73f..3e14971e6 100644
--- a/ldso/include/dl-string.h
+++ b/ldso/include/dl-string.h
@@ -135,12 +135,13 @@ static inline char *_dl_strstr(const char *s1, const char *s2)
static inline void * _dl_memcpy(void * dst, const void * src, size_t len)
{
- register char *a = dst;
- register const char *b = src;
-
- while (len--)
- *a++ = *b++;
+ register char *a = dst-1;
+ register const char *b = src-1;
+ while (len) {
+ *++a = *++b;
+ --len;
+ }
return dst;
}