summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2009-12-29 21:32:03 +0000
committerColin Watson <cjwatson@debian.org>2009-12-29 21:32:03 +0000
commit04942aa41fa94ec6f2c3ce1d348f600f31bb7c78 (patch)
treeaf8e928bd79d3f2d0219bb5b2c78b573ec31d94c /openbsd-compat/bsd-misc.c
parent9ad7b718d42e43f3a285fcbc8f91193931fce324 (diff)
parent16704d57999d987fb8d9ba53379841a79f016d67 (diff)
import openssh-4.2p1-gsskex-20050926-2.patch
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r--openbsd-compat/bsd-misc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 41f92cce9..6ba9bd986 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -18,7 +18,7 @@
18#include "includes.h" 18#include "includes.h"
19#include "xmalloc.h" 19#include "xmalloc.h"
20 20
21RCSID("$Id: bsd-misc.c,v 1.26 2005/02/25 23:07:38 dtucker Exp $"); 21RCSID("$Id: bsd-misc.c,v 1.27 2005/05/27 11:13:41 dtucker Exp $");
22 22
23#ifndef HAVE___PROGNAME 23#ifndef HAVE___PROGNAME
24char *__progname; 24char *__progname;
@@ -212,3 +212,21 @@ mysignal(int sig, mysig_t act)
212 return (signal(sig, act)); 212 return (signal(sig, act));
213#endif 213#endif
214} 214}
215
216#ifndef HAVE_STRDUP
217char *
218strdup(const char *str)
219{
220 size_t len;
221 char *cp;
222
223 len = strlen(str) + 1;
224 cp = malloc(len);
225 if (cp != NULL)
226 if (strlcpy(cp, str, len) != len) {
227 free(cp);
228 return NULL;
229 }
230 return cp;
231}
232#endif