Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The print now uses a more straight-forward map() instead of a join().
[rsync/rsync.git]
/
lib
/
compat.c
diff --git
a/lib/compat.c
b/lib/compat.c
index
6769490
..
8718a48
100644
(file)
--- a/
lib/compat.c
+++ b/
lib/compat.c
@@
-25,11
+25,11
@@
#ifndef HAVE_STRDUP
char *strdup(char *s)
{
#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
}
#endif