Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/completion-diff-submodule'
[gitweb.git]
/
compat
/
nedmalloc
/
nedmalloc.c
diff --git
a/compat/nedmalloc/nedmalloc.c
b/compat/nedmalloc/nedmalloc.c
index 677d1b2794321c7bd31bb5ba15c4bf8f2d06759e..2d4ef59013823d3c7caac8b705fbd4916cfe8fd6 100644
(file)
--- a/
compat/nedmalloc/nedmalloc.c
+++ b/
compat/nedmalloc/nedmalloc.c
@@
-955,12
+955,11
@@
void **nedpindependent_comalloc(nedpool *p, size_t elems, size_t *sizes, void **
*/
char *strdup(const char *s1)
{
-
char *s2 = 0
;
- if (s1) {
- size_t len = strlen(s1) + 1;
- s2 = malloc(len);
+
size_t len = strlen(s1) + 1
;
+ char *s2 = malloc(len);
+
+ if (s2)
memcpy(s2, s1, len);
- }
return s2;
}
#endif