~ubuntu-branches/ubuntu/dapper/openssh/dapper

« back to all changes in this revision

Viewing changes to openbsd-compat/bsd-misc.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2005-10-31 07:46:44 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051031074644-poik7e4un4723tr4
Tags: 1:4.2p1-5ubuntu1
Resynchronise with Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include "includes.h"
19
19
#include "xmalloc.h"
20
20
 
21
 
RCSID("$Id: bsd-misc.c,v 1.26 2005/02/25 23:07:38 dtucker Exp $");
 
21
RCSID("$Id: bsd-misc.c,v 1.27 2005/05/27 11:13:41 dtucker Exp $");
22
22
 
23
23
#ifndef HAVE___PROGNAME
24
24
char *__progname;
212
212
        return (signal(sig, act));
213
213
#endif
214
214
}
 
215
 
 
216
#ifndef HAVE_STRDUP
 
217
char *
 
218
strdup(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