From 2be1cbb7be25d32bc5741c96cc4d6951bd91fc30 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 27 May 2005 21:13:40 +1000 Subject: - (dtucker) [acconfig.h configure.ac defines.h includes.h sshpty.c openbsd-compat/bsd-misc.c] Add support for Ultrix. No, that's not a typo. Required changes from Bernhard Simon, integrated by me. ok djm@ --- openbsd-compat/bsd-misc.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/bsd-misc.c') 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 @@ #include "includes.h" #include "xmalloc.h" -RCSID("$Id: bsd-misc.c,v 1.26 2005/02/25 23:07:38 dtucker Exp $"); +RCSID("$Id: bsd-misc.c,v 1.27 2005/05/27 11:13:41 dtucker Exp $"); #ifndef HAVE___PROGNAME char *__progname; @@ -212,3 +212,21 @@ mysignal(int sig, mysig_t act) return (signal(sig, act)); #endif } + +#ifndef HAVE_STRDUP +char * +strdup(const char *str) +{ + size_t len; + char *cp; + + len = strlen(str) + 1; + cp = malloc(len); + if (cp != NULL) + if (strlcpy(cp, str, len) != len) { + free(cp); + return NULL; + } + return cp; +} +#endif -- cgit v1.2.3