diff options
author | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-23 20:38:44 +0000 |
---|---|---|
committer | (no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-01-23 20:38:44 +0000 |
commit | 2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b (patch) | |
tree | 89c47d81729687d5a69cadde99ee350306eb814f /src/common/utils.c | |
parent | c4e6857d4774b25dcd9b9137f76c14c92015d691 (diff) | |
download | hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.tar.gz hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.tar.bz2 hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.tar.xz hercules-2c5fabbc0b492cb5456e670ce9eb2352a11d5e3b.zip |
update
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@968 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/utils.c')
-rw-r--r-- | src/common/utils.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/utils.c b/src/common/utils.c index 9a7722478..732b1d366 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -4,6 +4,7 @@ #include <stdarg.h> #include <stdlib.h> #include "malloc.h" +#include "mmo.h" void dump(unsigned char *buffer, int num) { @@ -112,7 +113,7 @@ void str_lower(char *name) // Allocate a StringBuf [MouseJstr] struct StringBuf * StringBuf_Malloc() { - struct StringBuf * ret = (struct StringBuf *) malloc(sizeof(struct StringBuf)); + struct StringBuf * ret = (struct StringBuf *) aMallocA(sizeof(struct StringBuf)); StringBuf_Init(ret); return ret; } @@ -120,7 +121,7 @@ struct StringBuf * StringBuf_Malloc() // Initialize a previously allocated StringBuf [MouseJstr] void StringBuf_Init(struct StringBuf * sbuf) { sbuf->max_ = 1024; - sbuf->ptr_ = sbuf->buf_ = (char *) malloc(sbuf->max_ + 1); + sbuf->ptr_ = sbuf->buf_ = (char *) aMallocA(sbuf->max_ + 1); } // printf into a StringBuf, moving the pointer [MouseJstr] @@ -169,7 +170,7 @@ int StringBuf_Append(struct StringBuf *buf1,const struct StringBuf *buf2) // Destroy a StringBuf [MouseJstr] void StringBuf_Destroy(struct StringBuf *sbuf) { - free(sbuf->buf_); + aFree(sbuf->buf_); sbuf->ptr_ = sbuf->buf_ = 0; } @@ -177,7 +178,7 @@ void StringBuf_Destroy(struct StringBuf *sbuf) void StringBuf_Free(struct StringBuf *sbuf) { StringBuf_Destroy(sbuf); - free(sbuf); + aFree(sbuf); } // Return the built string from the StringBuf [MouseJstr] |