X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/c9bce0b8f8a485f11ce4f90356e9346036f14daf..204f4f4d091890d9106e744cffb9561e82df44ad:/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