mirror of
https://github.com/anope/anope.git
synced 2026-07-01 08:16:39 +02:00
Epic commit to replace most of the strings in Anope with a single Anope::string class, plus some other little fixes here and there. If you follow 1.9.x development and are testing things, THIS is one of those things that NEEDS testing.
This commit is contained in:
@@ -20,25 +20,6 @@
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* malloc, replacement so we can trap for "out of memory"
|
||||
* @param size to allocate
|
||||
* @return void
|
||||
*/
|
||||
void *smalloc(long size)
|
||||
{
|
||||
void *buf;
|
||||
|
||||
if (!size)
|
||||
size = 1;
|
||||
buf = malloc(size);
|
||||
if (!buf)
|
||||
abort();
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* calloc, replacement so we can trap for "out of memory"
|
||||
* @param elsize to allocate
|
||||
@@ -77,33 +58,6 @@ void *srealloc(void *oldptr, long newsize)
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* strdup, replacement so we can trap for "out of memory"
|
||||
* @param oldptr Old Pointer
|
||||
* @param newsize Size of new pointer
|
||||
* @return void
|
||||
*/
|
||||
char *sstrdup(const char *src)
|
||||
{
|
||||
char *ret = NULL;
|
||||
if (src)
|
||||
{
|
||||
ret = new char[strlen(src) + 1];
|
||||
if (!ret)
|
||||
abort();
|
||||
strcpy(ret, src);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alog() << "sstrdup() called with NULL-arg";
|
||||
abort();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user