summaryrefslogtreecommitdiff
path: root/Linux-PAM/libpam_misc/xstrdup.c
diff options
context:
space:
mode:
Diffstat (limited to 'Linux-PAM/libpam_misc/xstrdup.c')
-rw-r--r--Linux-PAM/libpam_misc/xstrdup.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/Linux-PAM/libpam_misc/xstrdup.c b/Linux-PAM/libpam_misc/xstrdup.c
deleted file mode 100644
index cce476e8..00000000
--- a/Linux-PAM/libpam_misc/xstrdup.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id: xstrdup.c,v 1.1.1.1 2000/06/20 22:11:25 agmorgan Exp $ */
-
-#include <malloc.h>
-#include <string.h>
-#include <security/pam_misc.h>
-
-/*
- * Safe duplication of character strings. "Paranoid"; don't leave
- * evidence of old token around for later stack analysis.
- */
-
-char *xstrdup(const char *x)
-{
- register char *new=NULL;
-
- if (x != NULL) {
- register int i;
-
- for (i=0; x[i]; ++i); /* length of string */
- if ((new = malloc(++i)) == NULL) {
- i = 0;
- } else {
- while (i-- > 0) {
- new[i] = x[i];
- }
- }
- x = NULL;
- }
-
- return new; /* return the duplicate or NULL on error */
-}