diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-29 04:00:19 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-29 04:00:19 +0000 |
commit | 4db583138b9556f72b13df7f66eeeace6a67ce3e (patch) | |
tree | 72b6589e9f7a0e46e2aa459cd6272bb90bfe7e96 /src/map/pc.c | |
parent | 525aa7d56ec5d74eac548d948782330d02df8f3e (diff) | |
download | hercules-4db583138b9556f72b13df7f66eeeace6a67ce3e.tar.gz hercules-4db583138b9556f72b13df7f66eeeace6a67ce3e.tar.bz2 hercules-4db583138b9556f72b13df7f66eeeace6a67ce3e.tar.xz hercules-4db583138b9556f72b13df7f66eeeace6a67ce3e.zip |
* Using malloc for memory allocations that doesn't need to be pre-initialized.
* Eliminated initializations for pointers returned by calloc.
* Moved grfio_final to do_init since it's not used after server boot.
* Optimized scripts to return CONSTSTR instead of allocating memory just to return a constant string. Some buildin functions still need work.
* Disabled graph since it doesn't work yet.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6355 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 036771b74..ed8dfbf62 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -7106,8 +7106,8 @@ int pc_read_gm_account(int fd) if (gm_account != NULL)
aFree(gm_account);
GM_num = 0;
- gm_account = (struct gm_account *) aCallocA(((RFIFOW(fd,2) - 4) / 5), sizeof(struct gm_account));
- for (i = 4; i < RFIFOW(fd,2); i = i + 5) {
+ gm_account = (struct gm_account *) aMallocA(((RFIFOW(fd,2) - 4) / 5)*sizeof(struct gm_account));
+ for (i = 4; i < RFIFOW(fd,2); i += 5) {
gm_account[GM_num].account_id = RFIFOL(fd,i);
gm_account[GM_num].level = (int)RFIFOB(fd,i+4);
//printf("GM account: %d -> level %d\n", gm_account[GM_num].account_id, gm_account[GM_num].level);
|