summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c258
1 files changed, 129 insertions, 129 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index bfe70145e..b4ccf5b79 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -782,7 +782,7 @@ is_atcommand_sub(const int fd, struct map_session_data* sd, const char* str, int
AtCommandInfo info;
AtCommandType type;
- malloc_set(&info, 0, sizeof(info));
+ memset(&info, 0, sizeof(info));
type = atcommand(sd, gmlvl, str, &info);
if (type != AtCommand_None) {
@@ -797,8 +797,8 @@ is_atcommand_sub(const int fd, struct map_session_data* sd, const char* str, int
return AtCommand_None;
}
- malloc_tsetdword(command, '\0', sizeof(command));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(command, '\0', sizeof(command));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
while (*p && !isspace(*p))
p++;
if (p - str >= sizeof(command)) // too long
@@ -877,7 +877,7 @@ AtCommandType atcommand(struct map_session_data* sd, const int level, const char
if (*p == atcommand_symbol) { // check first char, try to skip |00 (or something else) [Lance]
char command[101];
int i = 0;
- malloc_set(info, 0, sizeof(AtCommandInfo));
+ memset(info, 0, sizeof(AtCommandInfo));
sscanf(p, "%100s", command);
command[sizeof(command)-1] = '\0';
@@ -922,7 +922,7 @@ int msg_config_read(const char *cfgName) {
}
if ((--called) == 0)
- malloc_tsetdword(msg_table, 0, sizeof(msg_table[0]) * MAX_MSG);
+ memset(msg_table, 0, sizeof(msg_table[0]) * MAX_MSG);
while(fgets(line, sizeof(line)-1, fp)) {
if (line[0] == '/' && line[1] == '/')
continue;
@@ -1034,7 +1034,7 @@ int atcommand_commands(
int i_cur_cmd,gm_lvl = pc_isGM(sd), count = 0;
- malloc_tsetdword(cz_line_buff,' ',MESSAGE_SIZE);
+ memset(cz_line_buff,' ',MESSAGE_SIZE);
cz_line_buff[MESSAGE_SIZE] = 0;
clif_displaymessage(fd, msg_txt(273));
@@ -1052,7 +1052,7 @@ int atcommand_commands(
{
clif_displaymessage(fd,(char*)cz_line_buff);
lpcz_cur = cz_line_buff;
- malloc_tsetdword(cz_line_buff,' ',MESSAGE_SIZE);
+ memset(cz_line_buff,' ',MESSAGE_SIZE);
cz_line_buff[MESSAGE_SIZE] = 0;
}
@@ -1320,7 +1320,7 @@ int atcommand_rura(
nullpo_retr(-1, sd);
- malloc_tsetdword(map_name, '\0', sizeof(map_name));
+ memset(map_name, '\0', sizeof(map_name));
if (!message || !*message ||
(sscanf(message, "%15s %d %d", map_name, &x, &y) < 3 &&
@@ -1376,7 +1376,7 @@ int atcommand_where(
int GM_level, pl_GM_level;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof atcmd_player_name);
+ memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @where <char name>).");
@@ -1425,7 +1425,7 @@ int atcommand_jumpto(
return -1;
}
- malloc_tsetdword(atcmd_player_name, '\0', sizeof atcmd_player_name);
+ memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
if (sscanf(message, "%23[^\n]", atcmd_player_name) < 1)
return -1;
if(strncmp(sd->status.name,atcmd_player_name,NAME_LENGTH)==0) //Yourself mate? Tsk tsk tsk.
@@ -1463,7 +1463,7 @@ int atcommand_jump(
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
sscanf(message, "%d %d", &x, &y);
@@ -1498,9 +1498,9 @@ int atcommand_who3(
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(match_text, '\0', sizeof(match_text));
- malloc_tsetdword(player_name, '\0', sizeof(player_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(match_text, '\0', sizeof(match_text));
+ memset(player_name, '\0', sizeof(player_name));
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
@@ -1573,9 +1573,9 @@ int atcommand_who2(
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(match_text, '\0', sizeof(match_text));
- malloc_tsetdword(player_name, '\0', sizeof(player_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(match_text, '\0', sizeof(match_text));
+ memset(player_name, '\0', sizeof(player_name));
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
@@ -1645,10 +1645,10 @@ int atcommand_who(
nullpo_retr(-1, sd);
- malloc_tsetdword(temp0, '\0', sizeof(temp0));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(match_text, '\0', sizeof(match_text));
- malloc_tsetdword(player_name, '\0', sizeof(player_name));
+ memset(temp0, '\0', sizeof(temp0));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(match_text, '\0', sizeof(match_text));
+ memset(player_name, '\0', sizeof(player_name));
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
@@ -1722,8 +1722,8 @@ int atcommand_whomap3(
int map_id;
char map_name[MAP_NAME_LENGTH];
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(map_name, '\0', sizeof(map_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(map_name, '\0', sizeof(map_name));
if (!message || !*message)
map_id = sd->bl.m;
@@ -1782,8 +1782,8 @@ int atcommand_whomap2(
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(map_name, '\0', sizeof(map_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(map_name, '\0', sizeof(map_name));
if (!message || !*message)
map_id = sd->bl.m;
@@ -1846,10 +1846,10 @@ int atcommand_whomap(
nullpo_retr(-1, sd);
- malloc_tsetdword(temp0, '\0', sizeof(temp0));
- malloc_tsetdword(temp1, '\0', sizeof(temp1));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(map_name, '\0', sizeof(map_name));
+ memset(temp0, '\0', sizeof(temp0));
+ memset(temp1, '\0', sizeof(temp1));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(map_name, '\0', sizeof(map_name));
if (!message || !*message)
map_id = sd->bl.m;
@@ -1923,11 +1923,11 @@ int atcommand_whogm(
nullpo_retr(-1, sd);
- malloc_tsetdword(temp0, '\0', sizeof(temp0));
- malloc_tsetdword(temp1, '\0', sizeof(temp1));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(match_text, '\0', sizeof(match_text));
- malloc_tsetdword(player_name, '\0', sizeof(player_name));
+ memset(temp0, '\0', sizeof(temp0));
+ memset(temp1, '\0', sizeof(temp1));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(match_text, '\0', sizeof(match_text));
+ memset(player_name, '\0', sizeof(player_name));
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
@@ -1994,9 +1994,9 @@ int atcommand_whozeny(
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(match_text, '\0', sizeof(match_text));
- malloc_tsetdword(player_name, '\0', sizeof(player_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(match_text, '\0', sizeof(match_text));
+ memset(player_name, '\0', sizeof(player_name));
if (sscanf(message, "%99[^\n]", match_text) < 1)
strcpy(match_text, "");
@@ -2144,7 +2144,7 @@ int atcommand_speed(
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message) {
sprintf(atcmd_output, "Please, enter a speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED);
@@ -2179,8 +2179,8 @@ int atcommand_charspeed(
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%d %23[^\n]", &speed, atcmd_player_name) < 2) {
sprintf(atcmd_output, "Please, enter a speed and a player name (usage: @charspeed <speed <%d-%d>> <char name>).", MIN_WALK_SPEED, MAX_WALK_SPEED);
@@ -2474,7 +2474,7 @@ int atcommand_kill(
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @kill <char name>).");
@@ -2525,7 +2525,7 @@ int atcommand_kami(
unsigned long color=0;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if(*(command + 5) != 'c' && *(command + 5) != 'C') {
@@ -2626,7 +2626,7 @@ int atcommand_item(
int get_count, i;
nullpo_retr(-1, sd);
- malloc_tsetdword(item_name, '\0', sizeof(item_name));
+ memset(item_name, '\0', sizeof(item_name));
if (!message || !*message || sscanf(message, "%99s %d", item_name, &number) < 1) {
clif_displaymessage(fd, "Please, enter an item name/id (usage: @item <item name or ID> [quantity]).");
@@ -2652,7 +2652,7 @@ int atcommand_item(
for (i = 0; i < number; i += get_count) {
// if not pet egg
if (!pet_create_egg(sd, item_id)) {
- malloc_set(&item_tmp, 0, sizeof(item_tmp));
+ memset(&item_tmp, 0, sizeof(item_tmp));
item_tmp.nameid = item_id;
item_tmp.identify = 1;
@@ -2687,7 +2687,7 @@ int atcommand_item2(
int loop, get_count, i;
nullpo_retr(-1, sd);
- malloc_tsetdword(item_name, '\0', sizeof(item_name));
+ memset(item_name, '\0', sizeof(item_name));
if (!message || !*message || sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9) {
clif_displaymessage(fd, "Please, enter all informations (usage: @item2 <item name or ID> <quantity>");
@@ -2723,7 +2723,7 @@ int atcommand_item2(
refine = attr = 0;
}
for (i = 0; i < loop; i++) {
- malloc_set(&item_tmp, 0, sizeof(item_tmp));
+ memset(&item_tmp, 0, sizeof(item_tmp));
item_tmp.nameid = item_id;
item_tmp.identify = identify;
item_tmp.refine = refine;
@@ -2916,7 +2916,7 @@ int atcommand_help(
FILE* fp;
nullpo_retr(-1, sd);
- malloc_tsetdword(buf, '\0', sizeof(buf));
+ memset(buf, '\0', sizeof(buf));
if ((fp = fopen(help_txt, "r")) != NULL) {
clif_displaymessage(fd, msg_txt(26)); /* Help commands: */
@@ -2957,7 +2957,7 @@ int atcommand_help2(
FILE* fp;
nullpo_retr(-1, sd);
- malloc_tsetdword(buf, '\0', sizeof(buf));
+ memset(buf, '\0', sizeof(buf));
if ((fp = fopen(help2_txt, "r")) != NULL) {
clif_displaymessage(fd, msg_txt(26)); /* Help commands: */
@@ -2997,7 +2997,7 @@ int atcommand_gm(
char password[100];
nullpo_retr(-1, sd);
- malloc_tsetdword(password, '\0', sizeof(password));
+ memset(password, '\0', sizeof(password));
if (!message || !*message || sscanf(message, "%99[^\n]", password) < 1) {
clif_displaymessage(fd, "Please, enter a password (usage: @gm <password>).");
@@ -3143,7 +3143,7 @@ int atcommand_model(
int hair_style = 0, hair_color = 0, cloth_color = 0;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) {
sprintf(atcmd_output, "Please, enter at least a value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).",
@@ -3186,7 +3186,7 @@ int atcommand_dye(const int fd, struct map_session_data* sd, const char* command
int cloth_color = 0;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) {
sprintf(atcmd_output, "Please, enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).", MIN_CLOTH_COLOR, MAX_CLOTH_COLOR);
@@ -3214,7 +3214,7 @@ int atcommand_hair_style(const int fd, struct map_session_data* sd, const char*
int hair_style = 0;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) {
sprintf(atcmd_output, "Please, enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).", MIN_HAIR_STYLE, MAX_HAIR_STYLE);
@@ -3261,7 +3261,7 @@ int atcommand_hair_color(const int fd, struct map_session_data* sd, const char*
int hair_color = 0;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) {
sprintf(atcmd_output, "Please, enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).", MIN_HAIR_COLOR, MAX_HAIR_COLOR);
@@ -3335,8 +3335,8 @@ int atcommand_go(
return 0;
}
- malloc_tsetdword(map_name, '\0', sizeof(map_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(map_name, '\0', sizeof(map_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
// get the number
town = atoi(message);
@@ -3494,9 +3494,9 @@ int atcommand_monster(
short mx, my;
nullpo_retr(-1, sd);
- malloc_tsetdword(name, '\0', sizeof(name));
- malloc_tsetdword(monster, '\0', sizeof(monster));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(name, '\0', sizeof(name));
+ memset(monster, '\0', sizeof(monster));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message) {
clif_displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please.
@@ -3753,7 +3753,7 @@ void atcommand_killmonster_sub(
if (!sd) return;
- malloc_tsetdword(map_name, '\0', sizeof(map_name));
+ memset(map_name, '\0', sizeof(map_name));
if (!message || !*message || sscanf(message, "%15s", map_name) < 1)
map_id = sd->bl.m;
@@ -3811,7 +3811,7 @@ int atcommand_refine(
int count;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) {
clif_displaymessage(fd, "Please, enter a position and a amount (usage: @refine <equip position> <+/- amount>).");
@@ -3884,8 +3884,8 @@ int atcommand_produce(
struct item tmp_item;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(item_name, '\0', sizeof(item_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(item_name, '\0', sizeof(item_name));
if (!message || !*message || sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1) {
clif_displaymessage(fd, "Please, enter at least an item name/id (usage: @produce <equip name or equip ID> <element> <# of very's>).");
@@ -3906,7 +3906,7 @@ int atcommand_produce(
attribute = ATTRIBUTE_NORMAL;
if (star < MIN_STAR || star > MAX_STAR)
star = 0;
- malloc_set(&tmp_item, 0, sizeof tmp_item);
+ memset(&tmp_item, 0, sizeof tmp_item);
tmp_item.nameid = item_id;
tmp_item.amount = 1;
tmp_item.identify = 1;
@@ -3942,7 +3942,7 @@ void atcommand_memo_sub(struct map_session_data* sd) {
if (!sd) return;
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
clif_displaymessage(sd->fd, "Your actual memo positions are (except respawn point):");
for (i = MIN_PORTAL_MEMO; i <= MAX_PORTAL_MEMO; i++) {
@@ -3967,7 +3967,7 @@ int atcommand_memo(
int position = 0;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d", &position) < 1)
atcommand_memo_sub(sd);
@@ -4010,7 +4010,7 @@ int atcommand_gat(
int y;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
for (y = 2; y >= -2; y--) {
sprintf(atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X",
@@ -4240,7 +4240,7 @@ int atcommand_param(
status[4] = &sd->status.dex;
status[5] = &sd->status.luk;
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
sprintf(atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustement>).");
@@ -4568,7 +4568,7 @@ atcommand_recall(
return -1;
}
- malloc_tsetdword(atcmd_player_name, '\0', sizeof atcmd_player_name);
+ memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
if(sscanf(message, "%23[^\n]", atcmd_player_name) < 1)
return -1;
if(strncmp(sd->status.name,atcmd_player_name,NAME_LENGTH)==0)
@@ -4610,7 +4610,7 @@ int atcommand_revive(
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @revive <char name>).");
@@ -4643,7 +4643,7 @@ int atcommand_char_block(
{
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @charblock/@block <name>).");
@@ -4689,8 +4689,8 @@ int atcommand_char_ban(
int year, month, day, hour, minute, second, value;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%s %99[^\n]", atcmd_output, atcmd_player_name) < 2) {
clif_displaymessage(fd, "Please, enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish <time> <name>).");
@@ -4763,7 +4763,7 @@ int atcommand_char_unblock(
{
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @charunblock <player_name>).");
@@ -4796,7 +4796,7 @@ int atcommand_char_unban(
{
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%99[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @charunban <player_name>).");
@@ -4983,7 +4983,7 @@ int atcommand_kick(
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @kick <charname>).");
@@ -5176,7 +5176,7 @@ int atcommand_party(
char party[NAME_LENGTH];
nullpo_retr(-1, sd);
- malloc_tsetdword(party, '\0', sizeof(party));
+ memset(party, '\0', sizeof(party));
if (!message || !*message || sscanf(message, "%23[^\n]", party) < 1) {
clif_displaymessage(fd, "Please, enter a party name (usage: @party <party_name>).");
@@ -5200,7 +5200,7 @@ int atcommand_guild(
int prev;
nullpo_retr(-1, sd);
- malloc_tsetdword(guild, '\0', sizeof(guild));
+ memset(guild, '\0', sizeof(guild));
if (!message || !*message || sscanf(message, "%23[^\n]", guild) < 1) {
clif_displaymessage(fd, "Please, enter a guild name (usage: @guild <guild_name>).");
@@ -5296,8 +5296,8 @@ int atcommand_idsearch(
struct item_data *item_array[MAX_SEARCH];
nullpo_retr(-1, sd);
- malloc_tsetdword(item_name, '\0', sizeof(item_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(item_name, '\0', sizeof(item_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%99s", item_name) < 0) {
clif_displaymessage(fd, "Please, enter a part of item name (usage: @idsearch <part_of_item_name>).");
@@ -5335,7 +5335,7 @@ int atcommand_recallall(
int count, users;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, "You are not authorised to warp somenone to your actual map.");
@@ -5382,8 +5382,8 @@ int atcommand_guildrecall(
struct guild *g;
nullpo_retr(-1, sd);
- malloc_tsetdword(guild_name, '\0', sizeof(guild_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(guild_name, '\0', sizeof(guild_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) {
clif_displaymessage(fd, "Please, enter a guild name/id (usage: @guildrecall <guild_name/id>).");
@@ -5439,8 +5439,8 @@ int atcommand_partyrecall(
int count, users;
nullpo_retr(-1, sd);
- malloc_tsetdword(party_name, '\0', sizeof(party_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(party_name, '\0', sizeof(party_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) {
clif_displaymessage(fd, "Please, enter a party name/id (usage: @partyrecall <party_name/id>).");
@@ -5708,9 +5708,9 @@ int atcommand_mapinfo(
unsigned short m_index;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- malloc_tsetdword(direction, '\0', sizeof(direction));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(direction, '\0', sizeof(direction));
sscanf(message, "%d %23[^\n]", &list, atcmd_player_name);
@@ -5955,7 +5955,7 @@ int atcommand_char_mount_peco(
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @charmountpeco <char_name>).");
@@ -5996,8 +5996,8 @@ int atcommand_guildspy(
struct guild *g;
nullpo_retr(-1, sd);
- malloc_tsetdword(guild_name, '\0', sizeof(guild_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(guild_name, '\0', sizeof(guild_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!enable_spy)
{
@@ -6040,8 +6040,8 @@ int atcommand_partyspy(
struct party_data *p;
nullpo_retr(-1, sd);
- malloc_tsetdword(party_name, '\0', sizeof(party_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(party_name, '\0', sizeof(party_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!enable_spy)
{
@@ -6113,7 +6113,7 @@ int atcommand_nuke(
struct map_session_data *pl_sd;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @nuke <char name>).");
@@ -6149,7 +6149,7 @@ int atcommand_tonpc(const int fd, struct map_session_data* sd,
nullpo_retr(-1, sd);
- malloc_tsetdword(npcname, 0, sizeof(npcname));
+ memset(npcname, 0, sizeof(npcname));
if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) {
clif_displaymessage(fd, "Please, enter a NPC name (usage: @tonpc <NPC_name>).");
@@ -6179,7 +6179,7 @@ int atcommand_shownpc(const int fd, struct map_session_data* sd,
char NPCname[NAME_LENGTH];
nullpo_retr(-1, sd);
- malloc_tsetdword(NPCname, '\0', sizeof(NPCname));
+ memset(NPCname, '\0', sizeof(NPCname));
if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
clif_displaymessage(fd, "Please, enter a NPC name (usage: @enablenpc <NPC_name>).");
@@ -6207,7 +6207,7 @@ int atcommand_hidenpc(const int fd, struct map_session_data* sd,
char NPCname[NAME_LENGTH];
nullpo_retr(-1, sd);
- malloc_tsetdword(NPCname, '\0', sizeof(NPCname));
+ memset(NPCname, '\0', sizeof(NPCname));
if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
clif_displaymessage(fd, "Please, enter a NPC name (usage: @hidenpc <NPC_name>).");
@@ -6258,7 +6258,7 @@ int atcommand_unloadnpc(const int fd, struct map_session_data* sd,
char NPCname[NAME_LENGTH];
nullpo_retr(-1, sd);
- malloc_tsetdword(NPCname, '\0', sizeof(NPCname));
+ memset(NPCname, '\0', sizeof(NPCname));
if (!message || !*message || sscanf(message, "%23[^\n]", NPCname) < 1) {
clif_displaymessage(fd, "Please, enter a NPC name (usage: @npcoff <NPC_name>).");
@@ -6286,8 +6286,8 @@ char * txt_time(unsigned int duration) {
char temp[256];
static char temp1[256];
- malloc_tsetdword(temp, '\0', sizeof(temp));
- malloc_tsetdword(temp1, '\0', sizeof(temp1));
+ memset(temp, '\0', sizeof(temp));
+ memset(temp1, '\0', sizeof(temp1));
days = duration / (60 * 60 * 24);
duration = duration - (60 * 60 * 24 * days);
@@ -6331,7 +6331,7 @@ int atcommand_servertime(const int fd, struct map_session_data* sd,
char temp[256];
nullpo_retr(-1, sd);
- malloc_tsetdword(temp, '\0', sizeof(temp));
+ memset(temp, '\0', sizeof(temp));
time(&time_server); // get time in seconds since 1/1/1970
datetime = localtime(&time_server); // convert seconds in structure
@@ -6407,9 +6407,9 @@ int atcommand_chardelitem(const int fd, struct map_session_data* sd,
struct item_data *item_data;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- malloc_tsetdword(item_name, '\0', sizeof(item_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(item_name, '\0', sizeof(item_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message || sscanf(message, "%s %d %99[^\n]", item_name, &number, atcmd_player_name) < 3 || number < 1) {
clif_displaymessage(fd, "Please, enter an item name/id, a quantity and a player name (usage: @chardelitem <item_name_or_ID> <quantity> <player>).");
@@ -6505,7 +6505,7 @@ int atcommand_jail(
unsigned short m_index;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @jail <char_name>).");
@@ -6565,7 +6565,7 @@ int atcommand_unjail(
unsigned short m_index;
int x=0, y=0;
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @unjail/@discharge <char_name>).");
@@ -6918,7 +6918,7 @@ int atcommand_exp(
char output[200];
double nextb, nextj;
nullpo_retr(-1, sd);
- malloc_tsetdword(output, '\0', sizeof(output));
+ memset(output, '\0', sizeof(output));
nextb = pc_nextbaseexp(sd);
if (nextb)
@@ -6944,7 +6944,7 @@ int atcommand_broadcast(
{
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message) {
clif_displaymessage(fd, "Please, enter a message (usage: @broadcast <message>).");
@@ -6967,7 +6967,7 @@ int atcommand_localbroadcast(
{
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || !*message) {
clif_displaymessage(fd, "Please, enter a message (usage: @localbroadcast <message>).");
@@ -6994,8 +6994,8 @@ int atcommand_chardisguise(
struct map_session_data* pl_sd;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- malloc_tsetdword(mob_name, '\0', sizeof(mob_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(mob_name, '\0', sizeof(mob_name));
if (!message || !*message || sscanf(message, "%s %23[^\n]", mob_name, atcmd_player_name) < 2) {
clif_displaymessage(fd, "Please, enter a Monster/NPC name/id and a player name (usage: @chardisguise <monster_name_or_monster_ID> <char name>).");
@@ -7048,7 +7048,7 @@ int atcommand_charundisguise(
struct map_session_data* pl_sd;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @charundisguise <char name>).");
@@ -7087,8 +7087,8 @@ int atcommand_email(
char new_email[100];
nullpo_retr(-1, sd);
- malloc_tsetdword(actual_email, '\0', sizeof(actual_email));
- malloc_tsetdword(new_email, '\0', sizeof(new_email));
+ memset(actual_email, '\0', sizeof(actual_email));
+ memset(new_email, '\0', sizeof(new_email));
if (!message || !*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) {
clif_displaymessage(fd, "Please enter 2 emails (usage: @email <actual@email> <new@email>).");
@@ -7152,9 +7152,9 @@ atcommand_character_cart_list(
int i, j, count, counter, counter2;
nullpo_retr(-1, sd);
- malloc_tsetdword(atcmd_player_name, '\0', sizeof(atcmd_player_name));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(outputtmp, '\0', sizeof(outputtmp));
+ memset(atcmd_player_name, '\0', sizeof(atcmd_player_name));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(outputtmp, '\0', sizeof(outputtmp));
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
clif_displaymessage(fd, "Please, enter a player name (usage: @charitemlist <char name>).");
@@ -7178,7 +7178,7 @@ atcommand_character_cart_list(
else
sprintf(atcmd_output, "%d %s (%s, id: %d)", pl_sd->status.cart[i].amount, item_data->name, item_data->jname, pl_sd->status.cart[i].nameid);
clif_displaymessage(fd, atcmd_output);
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
counter2 = 0;
for (j = 0; j < item_data->slot; j++) {
if (pl_sd->status.cart[i].card[j]) {
@@ -7338,7 +7338,7 @@ atcommand_npcmove(const int fd, struct map_session_data* sd,
if (!message || !*message)
return -1;
- malloc_tsetdword(atcmd_player_name, '\0', sizeof atcmd_player_name);
+ memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
if (sscanf(message, "%d %d %23[^\n]", &x, &y, atcmd_player_name) < 3) {
clif_displaymessage(fd, "Usage: @npcmove <X> <Y> <npc_name>");
@@ -7727,7 +7727,7 @@ void getring (struct map_session_data *sd)
else
item_id = 2634;
- malloc_set(&item_tmp,0,sizeof(item_tmp));
+ memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid=item_id;
item_tmp.identify=1;
item_tmp.card[0]=255;
@@ -8365,7 +8365,7 @@ atcommand_sound(
return -1;
}
- malloc_tsetdword(sound_file, '\0', sizeof(sound_file));
+ memset(sound_file, '\0', sizeof(sound_file));
if(sscanf(message, "%99[^\n]", sound_file) < 1)
return -1;
@@ -8989,7 +8989,7 @@ int atcommand_jumptoid(
int cid=0;
struct map_session_data *pl_sd;
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || (cid = atoi(message)) == 0) {
clif_displaymessage(fd, "Please, enter a player CID (usage: @jumptoid/@warptoid/@gotoid <char id>).");
@@ -9034,7 +9034,7 @@ int atcommand_jumptoid2(
int aid=0;
struct map_session_data *pl_sd;
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || (aid = atoi(message)) == 0) {
clif_displaymessage(fd, "Please, enter a player AID (usage: @jumptoid/@warptoid/@gotoid <account id>).");
@@ -9078,7 +9078,7 @@ int atcommand_recallid(
int cid=0;
struct map_session_data *pl_sd;
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || (cid = atoi(message)) == 0) {
clif_displaymessage(fd, "Please, enter a player CID (usage: @recallid <char id>).");
@@ -9129,7 +9129,7 @@ int atcommand_recallid2(
int aid=0;
struct map_session_data *pl_sd;
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (!message || (aid = atoi(message)) == 0) {
clif_displaymessage(fd, "Please, enter a player AID (usage: @recallid2 <account id>).");
@@ -9567,8 +9567,8 @@ int atcommand_mobinfo(
int count;
int i, j, k;
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
- malloc_tsetdword(atcmd_output2, '\0', sizeof(atcmd_output2));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(atcmd_output2, '\0', sizeof(atcmd_output2));
if (!message || !*message) {
clif_displaymessage(fd, "Please, enter a Monster/ID (usage: @mobinfo <monster_name_or_monster_ID>).");
@@ -10237,8 +10237,8 @@ int atcommand_me(
char tempmes[200];
nullpo_retr(-1, sd);
- malloc_tsetdword(tempmes, '\0', sizeof(tempmes));
- malloc_tsetdword(atcmd_output, '\0', sizeof(atcmd_output));
+ memset(tempmes, '\0', sizeof(tempmes));
+ memset(atcmd_output, '\0', sizeof(atcmd_output));
if (sd->sc.count && //no "chatting" while muted.
(sd->sc.data[SC_BERSERK].timer!=-1 ||
@@ -10773,7 +10773,7 @@ int atcommand_request(
void do_init_atcommand() {
users_db = db_alloc(__FILE__,__LINE__,DB_UINT,DB_OPT_BASE,sizeof(int));
duel_count = 0;
- malloc_tsetdword(&duel_list[0], 0, sizeof(duel_list));
+ memset(&duel_list[0], 0, sizeof(duel_list));
add_timer_func_list(atshowmobs_timer, "atshowmobs_timer");
return;
}