summaryrefslogtreecommitdiff
path: root/src/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.c')
-rw-r--r--src/memory.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/memory.c b/src/memory.c
index 41e4a16ca..504bbaabe 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -3,7 +3,7 @@
* (C) 2003 Anope Team
* Contact us at info@anope.org
*
- * Please read COPYING and README for furhter details.
+ * Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
@@ -75,16 +75,26 @@ void *srealloc(void *oldptr, long newsize)
return buf;
}
-char *sstrdup(const char *s)
+char *sstrdup(const char *src)
{
- char *t = anopeStrDup(s);
- if (!t)
+ char *ret = NULL;
+ if (src) {
+#ifdef __STRICT_ANSI__
+ if ((ret = (char *) malloc(strlen(src) + 1))) {;
+ strcpy(ret, src);
+ }
+#else
+ ret = strdup(src);
+#endif
+ if (!ret)
#if !defined(USE_THREADS) || !defined(LINUX20)
- raise(SIGUSR1);
+ raise(SIGUSR1);
#else
- abort();
+ abort();
#endif
- return t;
+ }
+
+ return ret;
}
/*************************************************************************/