X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/e7c67065c060d500eba8d073da9568db2c658aad..8b498b9f1aa9f6419bb633e68a1c21d19c04e381:/lib/compat.c diff --git a/lib/compat.c b/lib/compat.c index 6769490f..8718a48f 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -25,11 +25,11 @@ #ifndef HAVE_STRDUP char *strdup(char *s) { - int l = strlen(s) + 1; - char *ret = (char *)malloc(l); - if (ret) - strcpy(ret,s); - return ret; + int len = strlen(s) + 1; + char *ret = (char *)malloc(len); + if (ret) + memcpy(ret, s, len); + return ret; } #endif