summaryrefslogtreecommitdiff
path: root/src/memory.c
diff options
context:
space:
mode:
authorrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-10-13 18:28:55 +0000
committerrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-10-13 18:28:55 +0000
commite6ed7b9eb57116b2d9a8e1d781fd334f409ed01b (patch)
tree03a1e12776aba3b4c5e7969ee829737544f56ce3 /src/memory.c
parent655889c154fdc3016038d6241a0c50978dd12fac (diff)
BUILD : 1.7.5 (395) BUGS : N/A NOTES : Fixed a typo in all source files, and merged sstrdup and anopeStrDup, as they do the same thing
git-svn-id: svn://svn.anope.org/anope/trunk@395 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@260 5417fbe8-f217-4b02-8779-1006273d7864
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;
}
/*************************************************************************/