diff options
Diffstat (limited to 'src')
40 files changed, 415 insertions, 415 deletions
diff --git a/src/char/char.c b/src/char/char.c index 927e0e8fa..91ad7d33d 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -358,7 +358,7 @@ int char_log(char *fmt, ...) else { time(&raw_time); strftime(tmpstr, 24, "%d-%m-%Y %H:%M:%S", localtime(&raw_time)); - snprintf(tmpstr + 19, sizeof (tmpstr + 19), ": %s", fmt); + sprintf(tmpstr + 19, ": %s", fmt); vfprintf(logfp, tmpstr, ap); } fclose(logfp); @@ -440,11 +440,11 @@ int mmo_friends_list_data_str(char *str, struct mmo_charstatus *p) { int i; char *str_p = str; - str_p += snprintf(str_p, sizeof str_p, "%d", p->char_id); + str_p += sprintf(str_p, "%d", p->char_id); for (i=0;i<MAX_FRIENDS;i++){ if (p->friends[i].account_id > 0 && p->friends[i].char_id > 0 && p->friends[i].name[0]) - str_p += snprintf(str_p, sizeof str_p, ",%d,%d,%s", p->friends[i].account_id, p->friends[i].char_id, p->friends[i].name); + str_p += sprintf(str_p, ",%d,%d,%s", p->friends[i].account_id, p->friends[i].char_id, p->friends[i].name); } str_p += '\0'; @@ -460,9 +460,9 @@ int mmo_hotkeys_tostr(char *str, struct mmo_charstatus *p) #ifdef HOTKEY_SAVING int i; char *str_p = str; - str_p += snprintf(str_p, sizeof str_p, "%d", p->char_id); + str_p += sprintf(str_p, "%d", p->char_id); for (i=0;i<MAX_HOTKEYS;i++) - str_p += snprintf(str_p, sizeof str_p, ",%d,%d,%d", p->hotkeys[i].type, p->hotkeys[i].id, p->hotkeys[i].lv); + str_p += sprintf(str_p, ",%d,%d,%d", p->hotkeys[i].type, p->hotkeys[i].id, p->hotkeys[i].lv); str_p += '\0'; #endif @@ -477,7 +477,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg, int i,j; char *str_p = str; - str_p += snprintf(str_p, sizeof str_p, + str_p += sprintf(str_p, "%d\t%d,%d\t%s\t%d,%d,%d\t%u,%u,%d" //Up to Zeny field "\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d" //Up to Skill Point "\t%d,%d,%d\t%d,%d,%d,%d" //Up to hom id @@ -499,41 +499,41 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg, p->partner_id,p->father,p->mother,p->child,p->fame); for(i = 0; i < MAX_MEMOPOINTS; i++) if (p->memo_point[i].map) { - str_p += snprintf(str_p, sizeof str_p, "%d,%d,%d ", p->memo_point[i].map, p->memo_point[i].x, p->memo_point[i].y); + str_p += sprintf(str_p, "%d,%d,%d ", p->memo_point[i].map, p->memo_point[i].x, p->memo_point[i].y); } *(str_p++) = '\t'; for(i = 0; i < MAX_INVENTORY; i++) if (p->inventory[i].nameid) { - str_p += snprintf(str_p,sizeof str_p,"%d,%d,%d,%d,%d,%d,%d", + str_p += sprintf(str_p,"%d,%d,%d,%d,%d,%d,%d", p->inventory[i].id,p->inventory[i].nameid,p->inventory[i].amount,p->inventory[i].equip, p->inventory[i].identify,p->inventory[i].refine,p->inventory[i].attribute); for(j=0; j<MAX_SLOTS; j++) - str_p += snprintf(str_p,sizeof str_p,",%d",p->inventory[i].card[j]); - str_p += snprintf(str_p,sizeof str_p," "); + str_p += sprintf(str_p,",%d",p->inventory[i].card[j]); + str_p += sprintf(str_p," "); } *(str_p++) = '\t'; for(i = 0; i < MAX_CART; i++) if (p->cart[i].nameid) { - str_p += snprintf(str_p,sizeof str_p,"%d,%d,%d,%d,%d,%d,%d", + str_p += sprintf(str_p,"%d,%d,%d,%d,%d,%d,%d", p->cart[i].id,p->cart[i].nameid,p->cart[i].amount,p->cart[i].equip, p->cart[i].identify,p->cart[i].refine,p->cart[i].attribute); for(j=0; j<MAX_SLOTS; j++) - str_p += snprintf(str_p,sizeof str_p,",%d",p->cart[i].card[j]); - str_p += snprintf(str_p,sizeof str_p," "); + str_p += sprintf(str_p,",%d",p->cart[i].card[j]); + str_p += sprintf(str_p," "); } *(str_p++) = '\t'; for(i = 0; i < MAX_SKILL; i++) if (p->skill[i].id && p->skill[i].flag != 1) { - str_p += snprintf(str_p, sizeof str_p, "%d,%d ", p->skill[i].id, (p->skill[i].flag == 0) ? p->skill[i].lv : p->skill[i].flag-2); + str_p += sprintf(str_p, "%d,%d ", p->skill[i].id, (p->skill[i].flag == 0) ? p->skill[i].lv : p->skill[i].flag-2); } *(str_p++) = '\t'; for(i = 0; i < reg_num; i++) if (reg[i].str[0]) - str_p += snprintf(str_p, sizeof str_p, "%s,%s ", reg[i].str, reg[i].value); + str_p += sprintf(str_p, "%s,%s ", reg[i].str, reg[i].value); *(str_p++) = '\t'; *str_p = '\0'; @@ -1496,7 +1496,7 @@ void create_online_files(void) // get time time(&time_server); // get time in seconds since 1/1/1970 datetime = localtime(&time_server); // convert seconds in structure - strftime(temp, sizeof(temp), "%d %b %Y %X", datetime); // like snprintf, but only for date/time (05 dec 2003 15:12:52) + strftime(temp, sizeof(temp), "%d %b %Y %X", datetime); // like sprintf, but only for date/time (05 dec 2003 15:12:52) // write heading fprintf(fp2, "<HTML>\n"); fprintf(fp2, " <META http-equiv=\"Refresh\" content=\"%d\">\n", online_refresh_html); // update on client explorer every x seconds diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 27bfcedc3..31cceeff0 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -42,14 +42,14 @@ int inter_guild_tostr(char* str, struct guild* g) int i, c, len; // save guild base info - len = snprintf(str, sizeof str, "%d\t%s\t%s\t%d,%d,%"PRIu64",%d,%d\t%s#\t%s#\t", + len = sprintf(str, "%d\t%s\t%s\t%d,%d,%"PRIu64",%d,%d\t%s#\t%s#\t", g->guild_id, g->name, g->master, g->guild_lv, g->max_member, g->exp, g->skill_point, 0, g->mes1, g->mes2); // save guild member info for(i = 0; i < g->max_member; i++) { struct guild_member *m = &g->member[i]; - len += snprintf(str + len, sizeof (str + len), "%d,%d,%d,%d,%d,%d,%d,%"PRIu64",%d,%d\t%s\t", + len += sprintf(str + len, "%d,%d,%d,%d,%d,%d,%d,%"PRIu64",%d,%d\t%s\t", m->account_id, m->char_id, m->hair, m->hair_color, m->gender, m->class_, m->lv, m->exp, m->exp_payper, m->position, @@ -59,26 +59,26 @@ int inter_guild_tostr(char* str, struct guild* g) // save guild position info for(i = 0; i < MAX_GUILDPOSITION; i++) { struct guild_position *p = &g->position[i]; - len += snprintf(str + len, sizeof (str + len), "%d,%d\t%s#\t", p->mode, p->exp_mode, p->name); + len += sprintf(str + len, "%d,%d\t%s#\t", p->mode, p->exp_mode, p->name); } // save guild emblem - len += snprintf(str + len, sizeof (str + len), "%d,%d,", g->emblem_len, g->emblem_id); + len += sprintf(str + len, "%d,%d,", g->emblem_len, g->emblem_id); for(i = 0; i < g->emblem_len; i++) { - len += snprintf(str + len, sizeof (str + len), "%02x", (unsigned char)(g->emblem_data[i])); + len += sprintf(str + len, "%02x", (unsigned char)(g->emblem_data[i])); } - len += snprintf(str + len, sizeof (str + len), "$\t"); + len += sprintf(str + len, "$\t"); // save guild alliance info c = 0; for(i = 0; i < MAX_GUILDALLIANCE; i++) if (g->alliance[i].guild_id > 0) c++; - len += snprintf(str + len, sizeof (str + len), "%d\t", c); + len += sprintf(str + len, "%d\t", c); for(i = 0; i < MAX_GUILDALLIANCE; i++) { struct guild_alliance *a = &g->alliance[i]; if (a->guild_id > 0) - len += snprintf(str + len, sizeof (str + len), "%d,%d\t%s\t", a->guild_id, a->opposition, a->name); + len += sprintf(str + len, "%d,%d\t%s\t", a->guild_id, a->opposition, a->name); } // save guild expulsion info @@ -86,19 +86,19 @@ int inter_guild_tostr(char* str, struct guild* g) for(i = 0; i < MAX_GUILDEXPULSION; i++) if (g->expulsion[i].account_id > 0) c++; - len += snprintf(str + len, sizeof (str + len), "%d\t", c); + len += sprintf(str + len, "%d\t", c); for(i = 0; i < MAX_GUILDEXPULSION; i++) { struct guild_expulsion *e = &g->expulsion[i]; if (e->account_id > 0) - len += snprintf(str + len, sizeof (str + len), "%d,%d,%d,%d\t%s\t%s\t%s#\t", + len += sprintf(str + len, "%d,%d,%d,%d\t%s\t%s\t%s#\t", e->account_id, 0, 0, 0, e->name, "#", e->mes ); } // save guild skill info for(i = 0; i < MAX_GUILDSKILL; i++) { - len += snprintf(str + len, sizeof (str + len), "%d,%d ", g->skill[i].id, g->skill[i].lv); + len += sprintf(str + len, "%d,%d ", g->skill[i].id, g->skill[i].lv); } - len += snprintf(str + len, sizeof (str + len), "\t"); + len += sprintf(str + len, "\t"); return 0; } @@ -309,7 +309,7 @@ int inter_guildcastle_tostr(char *str, struct guild_castle *gc) { int len; - len = snprintf(str, sizeof str, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", + len = sprintf(str, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", gc->castle_id, gc->guild_id, gc->economy, gc->defense, gc->triggerE, gc->triggerD, gc->nextTime, gc->payTime, gc->createTime, gc->visibleC, gc->guardian[0].visible, gc->guardian[1].visible, gc->guardian[2].visible, gc->guardian[3].visible, @@ -369,7 +369,7 @@ int inter_guild_readdb(void) char line[1024]; char path[1024]; - snprintf(path, sizeof path, "%s%s", db_path, "/exp_guild.txt"); + sprintf(path, "%s%s", db_path, "/exp_guild.txt"); fp = fopen(path, "r"); if (fp == NULL) { ShowError("can't read db/exp_guild.txt\n"); @@ -999,7 +999,7 @@ int mapif_parse_CreateGuild(int fd, int account_id, char *name, struct guild_mem strcpy(g->position[ 0].name, "GuildMaster"); strcpy(g->position[MAX_GUILDPOSITION-1].name, "Newbie"); for(i = 1; i < MAX_GUILDPOSITION-1; i++) - snprintf(g->position[i].name, sizeof g->position[i].name, "Position %d", i + 1); + sprintf(g->position[i].name, "Position %d", i + 1); // ここでギルド情報計算が必要と思われる g->max_member = 16; diff --git a/src/char/int_homun.c b/src/char/int_homun.c index d36150c4d..d547b60f7 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -24,7 +24,7 @@ int inter_homun_tostr(char *str,struct s_homunculus *p) { int i; - str+=snprintf(str, sizeof str, "%d,%d\t%s\t%d,%d,%d,%d,%d," + str+=sprintf(str,"%d,%d\t%s\t%d,%d,%d,%d,%d," "%u,%d,%d,%d," "%u,%d,%d," "%d,%d,%d,%d,%d,%d\t", @@ -37,7 +37,7 @@ int inter_homun_tostr(char *str,struct s_homunculus *p) for (i = 0; i < MAX_HOMUNSKILL; i++) { if (p->hskill[i].id && !p->hskill[i].flag) - str+=snprintf(str, sizeof str, "%d,%d,", p->hskill[i].id, p->hskill[i].lv); + str+=sprintf(str,"%d,%d,", p->hskill[i].id, p->hskill[i].lv); } return 0; diff --git a/src/char/int_party.c b/src/char/int_party.c index 3a43bc5ae..04d638049 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -107,10 +107,10 @@ static void int_party_calc_state(struct party_data *p) int inter_party_tostr(char *str, struct party *p) { int i, len; - len = snprintf(str, sizeof str, "%d\t%s\t%d,%d\t", p->party_id, p->name, p->exp, p->item); + len = sprintf(str, "%d\t%s\t%d,%d\t", p->party_id, p->name, p->exp, p->item); for(i = 0; i < MAX_PARTY; i++) { struct party_member *m = &p->member[i]; - len += snprintf(str + len, sizeof (str + len), "%d,%d,%d\t", m->account_id, m->char_id, m->leader); + len += sprintf(str + len, "%d,%d,%d\t", m->account_id, m->char_id, m->leader); } return 0; diff --git a/src/char/int_pet.c b/src/char/int_pet.c index 0be33e9c4..41d61fbc3 100644 --- a/src/char/int_pet.c +++ b/src/char/int_pet.c @@ -34,7 +34,7 @@ int inter_pet_tostr(char *str,struct s_pet *p) else if(p->intimate > 1000) p->intimate = 1000; - len=snprintf(str,sizeof str,"%d,%d,%s\t%d,%d,%d,%d,%d,%d,%d,%d,%d", + len=sprintf(str,"%d,%d,%s\t%d,%d,%d,%d,%d,%d,%d,%d,%d", p->pet_id,p->class_,p->name,p->account_id,p->char_id,p->level,p->egg_id, p->equip,p->intimate,p->hungry,p->rename_flag,p->incuvate); diff --git a/src/char/int_status.c b/src/char/int_status.c index 59779dc83..52b14ebbe 100644 --- a/src/char/int_status.c +++ b/src/char/int_status.c @@ -52,9 +52,9 @@ static void inter_status_tostr(char* line, struct scdata *sc_data) { int i, len; - len = snprintf(line, sizeof line, "%d,%d,%d\t", sc_data->account_id, sc_data->char_id, sc_data->count); + len = sprintf(line, "%d,%d,%d\t", sc_data->account_id, sc_data->char_id, sc_data->count); for(i = 0; i < sc_data->count; i++) { - len += snprintf(line + len, sizeof (line + len), "%d,%ld,%ld,%ld,%ld,%ld\t", sc_data->data[i].type, sc_data->data[i].tick, + len += sprintf(line + len, "%d,%ld,%ld,%ld,%ld,%ld\t", sc_data->data[i].type, sc_data->data[i].tick, sc_data->data[i].val1, sc_data->data[i].val2, sc_data->data[i].val3, sc_data->data[i].val4); } return; diff --git a/src/char/int_storage.c b/src/char/int_storage.c index ff682da87..bae72fcf4 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -31,17 +31,17 @@ bool storage_tostr(char* str, int account_id, struct storage_data* p) { int i,j; char *str_p = str; - str_p += snprintf(str_p, sizeof str_p, "%d,%d\t", account_id, p->storage_amount); + str_p += sprintf(str_p, "%d,%d\t", account_id, p->storage_amount); for( i = 0; i < MAX_STORAGE; i++ ) if( p->items[i].nameid > 0 && p->items[i].amount > 0 ) { - str_p += snprintf(str_p, sizeof str_p, "%d,%d,%d,%d,%d,%d,%d", + str_p += sprintf(str_p, "%d,%d,%d,%d,%d,%d,%d", p->items[i].id,p->items[i].nameid,p->items[i].amount,p->items[i].equip, p->items[i].identify,p->items[i].refine,p->items[i].attribute); for(j=0; j<MAX_SLOTS; j++) - str_p += snprintf(str_p,sizeof str_p,",%d",p->items[i].card[j]); - str_p += snprintf(str_p,sizeof str_p," "); + str_p += sprintf(str_p,",%d",p->items[i].card[j]); + str_p += sprintf(str_p," "); } *(str_p++)='\t'; @@ -98,16 +98,16 @@ int guild_storage_tostr(char *str,struct guild_storage *p) { int i,j,f=0; char *str_p = str; - str_p+=snprintf(str,sizeof str,"%d,%d\t",p->guild_id,p->storage_amount); + str_p+=sprintf(str,"%d,%d\t",p->guild_id,p->storage_amount); for(i=0;i<MAX_GUILD_STORAGE;i++) if( (p->storage_[i].nameid) && (p->storage_[i].amount) ){ - str_p += snprintf(str_p,sizeof str_p,"%d,%d,%d,%d,%d,%d,%d", + str_p += sprintf(str_p,"%d,%d,%d,%d,%d,%d,%d", p->storage_[i].id,p->storage_[i].nameid,p->storage_[i].amount,p->storage_[i].equip, p->storage_[i].identify,p->storage_[i].refine,p->storage_[i].attribute); for(j=0; j<MAX_SLOTS; j++) - str_p += snprintf(str_p,sizeof str_p,",%d",p->storage_[i].card[j]); - str_p += snprintf(str_p,sizeof str_p," "); + str_p += sprintf(str_p,",%d",p->storage_[i].card[j]); + str_p += sprintf(str_p," "); f++; } diff --git a/src/char/inter.c b/src/char/inter.c index 1c6dceb5c..8d9cac99f 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -78,9 +78,9 @@ int inter_accreg_tostr(char *str, struct accreg *reg) { int j; char *p = str; - p += snprintf(p, sizeof p, "%d\t", reg->account_id); + p += sprintf(p, "%d\t", reg->account_id); for(j = 0; j < reg->reg_num; j++) { - p += snprintf(p, sizeof p, "%s,%s ", reg->reg[j].str, reg->reg[j].value); + p += sprintf(p,"%s,%s ", reg->reg[j].str, reg->reg[j].value); } return 0; diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index da5aa67bb..0b3d77f07 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -652,7 +652,7 @@ int inter_guild_ReadEXP(void) char line[1024]; for (i=0;i<100;i++) guild_exp[i]=0; - snprintf(line, sizeof line, "%s/exp_guild.txt", db_path); + sprintf(line, "%s/exp_guild.txt", db_path); fp=fopen(line,"r"); if(fp==NULL){ ShowError("can't read %s\n", line); @@ -1278,7 +1278,7 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member strcpy(g->position[MAX_GUILDPOSITION-1].name,"Newbie"); g->position[0].modified = g->position[MAX_GUILDPOSITION-1].modified = GS_POSITION_MODIFIED; for(i=1;i<MAX_GUILDPOSITION-1;i++) { - snprintf(g->position[i].name,sizeof g->position[i].name,"Position %d",i+1); + sprintf(g->position[i].name,"Position %d",i+1); g->position[i].modified = GS_POSITION_MODIFIED; } diff --git a/src/common/grfio.c b/src/common/grfio.c index 82bf57bf6..fe94e0803 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -398,7 +398,7 @@ int grfio_size(char* fname) FILELIST lentry; struct stat st; - snprintf(lfname, sizeof lfname, "%s%s", data_dir, fname); + sprintf(lfname, "%s%s", data_dir, fname); for (p = &lfname[0]; *p != 0; p++) if (*p=='\\') *p = '/'; @@ -431,7 +431,7 @@ void* grfio_reads(char* fname, int* size) char lfname[256], *p; FILELIST lentry; - snprintf(lfname, sizeof lfname, "%s%s", data_dir, fname); + sprintf(lfname, "%s%s", data_dir, fname); for (p = &lfname[0]; *p != 0; p++) if (*p == '\\') *p = '/'; @@ -694,7 +694,7 @@ static void grfio_resourcecheck(void) int i = 0; // read resnametable from data directory and return if successful - snprintf(restable, sizeof restable, "%sdata\\resnametable.txt", data_dir); + sprintf(restable, "%sdata\\resnametable.txt", data_dir); for (ptr = &restable[0]; *ptr != 0; ptr++) if (*ptr == '\\') *ptr = '/'; @@ -706,8 +706,8 @@ static void grfio_resourcecheck(void) // we only need the maps' GAT and RSW files (strstr(w2, ".gat") || strstr(w2, ".rsw"))) { - snprintf(src, sizeof src, "data\\%s", w1); - snprintf(dst, sizeof dst, "data\\%s", w2); + sprintf(src, "data\\%s", w1); + sprintf(dst, "data\\%s", w2); entry = filelist_find(dst); // create new entries reusing the original's info if (entry != NULL) { @@ -735,8 +735,8 @@ static void grfio_resourcecheck(void) if (sscanf(ptr, "%[^#]#%[^#]#", w1, w2) == 2 && (strstr(w2, ".gat") || strstr(w2, ".rsw"))) { - snprintf(src, sizeof src, "data\\%s", w1); - snprintf(dst, sizeof dst, "data\\%s", w2); + sprintf(src, "data\\%s", w1); + sprintf(dst, "data\\%s", w2); entry = filelist_find(dst); if (entry != NULL) { FILELIST fentry; diff --git a/src/common/lock.c b/src/common/lock.c index a4bcc7fe0..643b86e5c 100644 --- a/src/common/lock.c +++ b/src/common/lock.c @@ -25,7 +25,7 @@ FILE* lock_fopen (const char* filename, int *info) { // 安全なファイル名を得る(手抜き) do { - snprintf(newfile, sizeof newfile, "%s_%04d.tmp", filename, ++no); + sprintf(newfile, "%s_%04d.tmp", filename, ++no); } while(exists(newfile) && no < 9999); *info = no; return fopen(newfile,"w"); @@ -38,8 +38,8 @@ int lock_fclose (FILE *fp, const char* filename, int *info) { char oldfile[512]; if (fp != NULL) { ret = fclose(fp); - snprintf(newfile, sizeof newfile, "%s_%04d.tmp", filename, *info); - snprintf(oldfile, sizeof oldfile, "%s.bak", filename); // old backup file + sprintf(newfile, "%s_%04d.tmp", filename, *info); + sprintf(oldfile, "%s.bak", filename); // old backup file if (exists(oldfile)) remove(oldfile); // remove backup file if it already exists rename (filename, oldfile); // backup our older data instead of deleting it diff --git a/src/common/malloc.c b/src/common/malloc.c index 57300c18f..b566e689f 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -602,7 +602,7 @@ static void memmgr_final (void) char* ptr = (char *)head + sizeof(struct unit_head) - sizeof(long); #ifdef LOG_MEMMGR char buf[1024]; - snprintf (buf, sizeof buf, + sprintf (buf, "%04d : %s line %d size %lu address 0x%p\n", ++count, head->file, head->line, (unsigned long)head->size, ptr); memmgr_log (buf); @@ -619,7 +619,7 @@ static void memmgr_final (void) struct unit_head_large *large2; #ifdef LOG_MEMMGR char buf[1024]; - snprintf (buf, sizeof buf, + sprintf (buf, "%04d : %s line %d size %lu address 0x%p\n", ++count, large->unit_head.file, large->unit_head.line, (unsigned long)large->size, &large->unit_head.checksum); memmgr_log (buf); @@ -642,7 +642,7 @@ static void memmgr_final (void) static void memmgr_init (void) { #ifdef LOG_MEMMGR - snprintf(memmer_logfile, sizeof memmer_logfile, "log/%s.leaks", SERVER_NAME); + sprintf(memmer_logfile, "log/%s.leaks", SERVER_NAME); ShowStatus("Memory manager initialised: "CL_WHITE"%s"CL_RESET"\n", memmer_logfile); memset(hash_unfill, 0, sizeof(hash_unfill)); #endif /* LOG_MEMMGR */ diff --git a/src/common/md5calc.c b/src/common/md5calc.c index 08ad09ee1..2178739d6 100644 --- a/src/common/md5calc.c +++ b/src/common/md5calc.c @@ -222,7 +222,7 @@ void MD5_String(const char * string, char * output) unsigned char digest[16]; MD5_String2binary(string,digest); - snprintf(output, sizeof output, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + sprintf(output, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", digest[ 0], digest[ 1], digest[ 2], digest[ 3], digest[ 4], digest[ 5], digest[ 6], digest[ 7], digest[ 8], digest[ 9], digest[10], digest[11], diff --git a/src/common/plugins.c b/src/common/plugins.c index 614ac3c3a..2d81548a1 100644 --- a/src/common/plugins.c +++ b/src/common/plugins.c @@ -320,7 +320,7 @@ static int plugins_config_read(const char *cfgName) auto_search = atoi(w2); } else if( strcmpi(w1,"plugin") == 0 ){ char filename[128]; - snprintf(filename, sizeof filename, "plugins/%s%s", w2, DLL_EXT); + sprintf(filename, "plugins/%s%s", w2, DLL_EXT); plugin_load(filename); } else if( strcmpi(w1,"import") == 0 ) plugins_config_read(w2); diff --git a/src/common/utils.c b/src/common/utils.c index a95072f7d..12123784f 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -104,7 +104,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*)) if (strcmp(FindFileData.cFileName, "..") == 0) continue; - snprintf(tmppath,sizeof tmppath,"%s%c%s",path,PATHSEP,FindFileData.cFileName); + sprintf(tmppath,"%s%c%s",path,PATHSEP,FindFileData.cFileName); if (FindFileData.cFileName && strstr(FindFileData.cFileName, pattern)) { func( tmppath ); @@ -166,7 +166,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*)) if (strcmp(entry->d_name, "..") == 0) continue; - snprintf(tmppath,sizeof tmppath,"%s%c%s",path, PATHSEP, entry->d_name); + sprintf(tmppath,"%s%c%s",path, PATHSEP, entry->d_name); // check if the pattern matchs. if (entry->d_name && strstr(entry->d_name, pattern)) { diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c index 7f75e3017..3f02a240a 100644 --- a/src/ladmin/ladmin.c +++ b/src/ladmin/ladmin.c @@ -250,7 +250,7 @@ int ladmin_log(char *fmt, ...) else { t = time(NULL); strftime(tmpstr, 24, date_format, localtime(&t)); - snprintf(tmpstr + strlen(tmpstr), sizeof (tmpstr + strlen(tmpstr)), ": %s", fmt); + sprintf(tmpstr + strlen(tmpstr), ": %s", fmt); vfprintf(logfp, tmpstr, ap); } fclose(logfp); @@ -2523,7 +2523,7 @@ int parse_fromlogin(int fd) ladmin_log("Account [%s] state changing failed. Account doesn't exist.\n", RFIFOP(fd,6)); } else { char tmpstr[256]; - snprintf(tmpstr, sizeof tmpstr, "Account [%s] state successfully changed in [", RFIFOP(fd,6)); + sprintf(tmpstr, "Account [%s] state successfully changed in [", RFIFOP(fd,6)); switch(RFIFOL(fd,30)) { case 0: strcat(tmpstr, "0: Account OK"); diff --git a/src/login/account_txt.c b/src/login/account_txt.c index 9caf5ca6b..ba3388c57 100644 --- a/src/login/account_txt.c +++ b/src/login/account_txt.c @@ -558,14 +558,14 @@ static bool mmo_auth_tostr(const struct mmo_account* a, char* str) int i; char* str_p = str; - str_p += snprintf(str_p, sizeof str_p, "%d\t%s\t%s\t%c\t%s\t%u\t%u\t%ld\t%ld\t%u\t%s\t%s\t", + str_p += sprintf(str_p, "%d\t%s\t%s\t%c\t%s\t%u\t%u\t%ld\t%ld\t%u\t%s\t%s\t", a->account_id, a->userid, a->pass, a->sex, a->email, a->level, a->state, (long)a->unban_time, (long)a->expiration_time, a->logincount, a->lastlogin, a->last_ip); for( i = 0; i < a->account_reg2_num; ++i ) if( a->account_reg2[i].str[0] ) - str_p += snprintf(str_p, sizeof str_p, "%s,%s ", a->account_reg2[i].str, a->account_reg2[i].value); + str_p += sprintf(str_p, "%s,%s ", a->account_reg2[i].str, a->account_reg2[i].value); return true; } diff --git a/src/login/login.c b/src/login/login.c index 414714bd3..e888d21f6 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -934,11 +934,11 @@ int mmo_auth(struct login_session_data* sd) bool matched = false; uint8* sin_addr = (uint8*)&session[sd->fd]->client_addr; - snprintf(r_ip, sizeof r_ip, "%u.%u.%u.%u", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]); + sprintf(r_ip, "%u.%u.%u.%u", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]); for( dnsbl_serv = strtok(login_config.dnsbl_servs,","); !matched && dnsbl_serv != NULL; dnsbl_serv = strtok(NULL,",") ) { - snprintf(ip_dnsbl, sizeof ip_dnsbl, "%s.%s", r_ip, dnsbl_serv); + sprintf(ip_dnsbl, "%s.%s", r_ip, dnsbl_serv); if( host2ip(ip_dnsbl) ) matched = true; } @@ -1383,7 +1383,7 @@ int parse_login(int fd) RFIFOSKIP(fd,86); ShowInfo("Connection request of the char-server '%s' @ %u.%u.%u.%u:%u (account: '%s', pass: '%s', ip: '%s')\n", server_name, CONVIP(server_ip), server_port, sd->userid, sd->passwd, ip); - snprintf(message, sizeof message, "charserver - %s@%u.%u.%u.%u:%u", server_name, CONVIP(server_ip), server_port); + sprintf(message, "charserver - %s@%u.%u.%u.%u:%u", server_name, CONVIP(server_ip), server_port); login_log(session[fd]->client_addr, sd->userid, 100, message); result = mmo_auth(sd); diff --git a/src/map/atcommand.c b/src/map/atcommand.c index aa77fcf0e..6f008c3af 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -112,7 +112,7 @@ static char* player_title_txt(int level) : (level >= battle_config.title_lvl2) ? msg_txt(326) : (level >= battle_config.title_lvl1) ? msg_txt(325) : ""; - snprintf(atcmd_temp, sizeof atcmd_temp, format, level); + sprintf(atcmd_temp, format, level); return atcmd_temp; } @@ -197,7 +197,7 @@ ACMD_FUNC(send) #define PARSE_ERROR(error,p) \ {\ clif_displaymessage(fd, (error));\ - snprintf(atcmd_output, sizeof atcmd_output, ">%s", (p));\ + sprintf(atcmd_output, ">%s", (p));\ clif_displaymessage(fd, atcmd_output);\ } //define PARSE_ERROR @@ -229,7 +229,7 @@ ACMD_FUNC(send) if(len) {// show packet length - snprintf(atcmd_output, sizeof atcmd_output, "Packet 0x%x length: %d", type, packet_db[sd->packet_ver][type].len); + sprintf(atcmd_output, "Packet 0x%x length: %d", type, packet_db[sd->packet_ver][type].len); clif_displaymessage(fd, atcmd_output); return 0; } @@ -238,7 +238,7 @@ ACMD_FUNC(send) off=2; if(len == 0) {// unknown packet - ERROR - snprintf(atcmd_output, sizeof atcmd_output, "Unknown packet: 0x%x", type); + sprintf(atcmd_output, "Unknown packet: 0x%x", type); clif_displaymessage(fd, atcmd_output); return -1; } else if(len == -1) @@ -399,7 +399,7 @@ ACMD_FUNC(send) clif_displaymessage(fd, msg_txt(259)); // Invalid packet return -1; } - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d) + sprintf (atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d) clif_displaymessage(fd, atcmd_output); return 0; #undef PARSE_ERROR @@ -536,7 +536,7 @@ ACMD_FUNC(jumpto) } pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s + sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s clif_displaymessage(fd, atcmd_output); return 0; @@ -573,7 +573,7 @@ ACMD_FUNC(jump) } pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d + sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d clif_displaymessage(fd, atcmd_output); return 0; } @@ -617,21 +617,21 @@ ACMD_FUNC(who3) if (strstr(player_name, match_text) != NULL) { // search with no case sensitive if (battle_config.who_display_aid > 0 && pc_isGM(sd) >= battle_config.who_display_aid) { - snprintf(atcmd_output, sizeof atcmd_output, "(CID:%d/AID:%d) ", pl_sd->status.char_id, pl_sd->status.account_id); + sprintf(atcmd_output, "(CID:%d/AID:%d) ", pl_sd->status.char_id, pl_sd->status.account_id); } else { atcmd_output[0]=0; } //Player name - snprintf(temp0, sizeof temp0, msg_txt(333), pl_sd->status.name); + sprintf(temp0, msg_txt(333), pl_sd->status.name); strcat(atcmd_output,temp0); //Player title, if exists if (pl_GM_level > 0) { - //snprintf(temp0, sizeof temp0, "(%s) ", player_title_txt(pl_GM_level) ); - snprintf(temp0, sizeof temp0, msg_txt(334), player_title_txt(pl_GM_level) ); + //sprintf(temp0, "(%s) ", player_title_txt(pl_GM_level) ); + sprintf(temp0, msg_txt(334), player_title_txt(pl_GM_level) ); strcat(atcmd_output,temp0); } //Players Location: map x y - snprintf(temp0, sizeof temp0, msg_txt(338), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); + sprintf(temp0, msg_txt(338), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); strcat(atcmd_output,temp0); clif_displaymessage(fd, atcmd_output); @@ -646,7 +646,7 @@ ACMD_FUNC(who3) else if (count == 1) clif_displaymessage(fd, msg_txt(29)); // 1 player found. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(30), count); // %d players found. + sprintf(atcmd_output, msg_txt(30), count); // %d players found. clif_displaymessage(fd, atcmd_output); } @@ -691,17 +691,17 @@ ACMD_FUNC(who2) player_name[j] = TOLOWER(player_name[j]); if (strstr(player_name, match_text) != NULL) { // search with no case sensitive //Players Name - //snprintf(atcmd_output, sizeof atcmd_output, "Name: %s ", pl_sd->status.name); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(333), pl_sd->status.name); + //sprintf(atcmd_output, "Name: %s ", pl_sd->status.name); + sprintf(atcmd_output, msg_txt(333), pl_sd->status.name); //Player title, if exists if (pl_GM_level > 0) { - //snprintf(temp0, sizeof temp0, "(%s) ", player_title_txt(pl_GM_level) ); - snprintf(temp0, sizeof temp0, msg_txt(334), player_title_txt(pl_GM_level) ); + //sprintf(temp0, "(%s) ", player_title_txt(pl_GM_level) ); + sprintf(temp0, msg_txt(334), player_title_txt(pl_GM_level) ); strcat(atcmd_output,temp0); } //Players Base Level / Job name - //snprintf(temp0, sizeof temp0, "| L:%d/%d | Job: %s", pl_sd->status.base_level, pl_sd->status.job_level, job_name(pl_sd->status.class_) ); - snprintf(temp0, sizeof temp0, msg_txt(337), pl_sd->status.base_level, pl_sd->status.job_level, job_name(pl_sd->status.class_) ); + //sprintf(temp0, "| L:%d/%d | Job: %s", pl_sd->status.base_level, pl_sd->status.job_level, job_name(pl_sd->status.class_) ); + sprintf(temp0, msg_txt(337), pl_sd->status.base_level, pl_sd->status.job_level, job_name(pl_sd->status.class_) ); strcat(atcmd_output,temp0); clif_displaymessage(fd, atcmd_output); @@ -716,7 +716,7 @@ ACMD_FUNC(who2) else if (count == 1) clif_displaymessage(fd, msg_txt(29)); // 1 player found. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(30), count); // %d players found. + sprintf(atcmd_output, msg_txt(30), count); // %d players found. clif_displaymessage(fd, atcmd_output); } @@ -766,22 +766,22 @@ ACMD_FUNC(who) g = guild_search(pl_sd->status.guild_id); p = party_search(pl_sd->status.party_id); //Players Name - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(333), pl_sd->status.name); + sprintf(atcmd_output, msg_txt(333), pl_sd->status.name); //Player title, if exists if (pl_GM_level > 0) { - snprintf(temp0, sizeof temp0, msg_txt(334), player_title_txt(pl_GM_level) ); + sprintf(temp0, msg_txt(334), player_title_txt(pl_GM_level) ); strcat(atcmd_output,temp0); } //Players Party if exists if (p != NULL) { - //snprintf(temp0, sizeof temp0, " | Party: '%s'", p->name); - snprintf(temp0, sizeof temp0, msg_txt(335), p->party.name); + //sprintf(temp0," | Party: '%s'", p->name); + sprintf(temp0, msg_txt(335), p->party.name); strcat(atcmd_output,temp0); } //Players Guild if exists if (g != NULL) { - //snprintf(temp0, sizeof temp0, " | Guild: '%s'", g->name); - snprintf(temp0, sizeof temp0, msg_txt(336), g->name); + //sprintf(temp0," | Guild: '%s'", g->name); + sprintf(temp0, msg_txt(336), g->name); strcat(atcmd_output,temp0); } clif_displaymessage(fd, atcmd_output); @@ -796,7 +796,7 @@ ACMD_FUNC(who) else if (count == 1) clif_displaymessage(fd, msg_txt(29)); // 1 player found. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(30), count); // %d players found. + sprintf(atcmd_output, msg_txt(30), count); // %d players found. clif_displaymessage(fd, atcmd_output); } @@ -839,20 +839,20 @@ ACMD_FUNC(whomap3) continue; if (pl_GM_level > 0) - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); + sprintf(atcmd_output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); else - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s | Location: %s %d %d", pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); + sprintf(atcmd_output, "Name: %s | Location: %s %d %d", pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); clif_displaymessage(fd, atcmd_output); count++; } mapit_free(iter); if (count == 0) - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(54), map[map_id].name); // No player found in map '%s'. + sprintf(atcmd_output, msg_txt(54), map[map_id].name); // No player found in map '%s'. else if (count == 1) - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(55), map[map_id].name); // 1 player found in map '%s'. + sprintf(atcmd_output, msg_txt(55), map[map_id].name); // 1 player found in map '%s'. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. + sprintf(atcmd_output, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. } clif_displaymessage(fd, atcmd_output); @@ -897,20 +897,20 @@ ACMD_FUNC(whomap2) continue; if (pl_GM_level > 0) - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); + sprintf(atcmd_output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); else - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); + sprintf(atcmd_output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); clif_displaymessage(fd, atcmd_output); count++; } mapit_free(iter); if (count == 0) - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(54), map[map_id].name); // No player found in map '%s'. + sprintf(atcmd_output, msg_txt(54), map[map_id].name); // No player found in map '%s'. else if (count == 1) - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(55), map[map_id].name); // 1 player found in map '%s'. + sprintf(atcmd_output, msg_txt(55), map[map_id].name); // 1 player found in map '%s'. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. + sprintf(atcmd_output, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. } clif_displaymessage(fd, atcmd_output); @@ -962,29 +962,29 @@ ACMD_FUNC(whomap) g = guild_search(pl_sd->status.guild_id); if (g == NULL) - snprintf(temp1, sizeof temp1, "None"); + sprintf(temp1, "None"); else - snprintf(temp1, sizeof temp1, "%s", g->name); + sprintf(temp1, "%s", g->name); p = party_search(pl_sd->status.party_id); if (p == NULL) - snprintf(temp0, sizeof temp0, "None"); + sprintf(temp0, "None"); else - snprintf(temp0, sizeof temp0, "%s", p->party.name); + sprintf(temp0, "%s", p->party.name); if (pl_GM_level > 0) - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'", pl_sd->status.name, pl_GM_level, temp0, temp1); + sprintf(atcmd_output, "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'", pl_sd->status.name, pl_GM_level, temp0, temp1); else - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s | Party: '%s' | Guild: '%s'", pl_sd->status.name, temp0, temp1); + sprintf(atcmd_output, "Name: %s | Party: '%s' | Guild: '%s'", pl_sd->status.name, temp0, temp1); clif_displaymessage(fd, atcmd_output); count++; } mapit_free(iter); if (count == 0) - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(54), map[map_id].name); // No player found in map '%s'. + sprintf(atcmd_output, msg_txt(54), map[map_id].name); // No player found in map '%s'. else if (count == 1) - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(55), map[map_id].name); // 1 player found in map '%s'. + sprintf(atcmd_output, msg_txt(55), map[map_id].name); // 1 player found in map '%s'. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. + sprintf(atcmd_output, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. } clif_displaymessage(fd, atcmd_output); @@ -1038,18 +1038,18 @@ ACMD_FUNC(whogm) if (pl_GM_level > GM_level) { if (pl_sd->sc.option & OPTION_INVISIBLE) continue; - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s (GM)", pl_sd->status.name); + sprintf(atcmd_output, "Name: %s (GM)", pl_sd->status.name); clif_displaymessage(fd, atcmd_output); count++; continue; } - snprintf(atcmd_output, sizeof atcmd_output, "Name: %s (GM:%d) | Location: %s %d %d", + sprintf(atcmd_output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, " BLvl: %d | Job: %s (Lvl: %d)", + sprintf(atcmd_output, " BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); clif_displaymessage(fd, atcmd_output); @@ -1057,7 +1057,7 @@ ACMD_FUNC(whogm) p = party_search(pl_sd->status.party_id); g = guild_search(pl_sd->status.guild_id); - snprintf(atcmd_output, sizeof atcmd_output," Party: '%s' | Guild: '%s'", + sprintf(atcmd_output," Party: '%s' | Guild: '%s'", p?p->party.name:"None", g?g->name:"None"); clif_displaymessage(fd, atcmd_output); @@ -1070,7 +1070,7 @@ ACMD_FUNC(whogm) else if (count == 1) clif_displaymessage(fd, msg_txt(151)); // 1 GM found. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(152), count); // %d GMs found. + sprintf(atcmd_output, msg_txt(152), count); // %d GMs found. clif_displaymessage(fd, atcmd_output); } @@ -1132,7 +1132,7 @@ ACMD_FUNC(speed) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &speed) < 1) { - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter a speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED); + sprintf(atcmd_output, "Please, enter a speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED); clif_displaymessage(fd, atcmd_output); return -1; } @@ -2052,7 +2052,7 @@ ACMD_FUNC(model) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) { - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter at least a value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).", + sprintf(atcmd_output, "Please, enter at least a value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>).", MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); clif_displaymessage(fd, atcmd_output); return -1; @@ -2084,7 +2084,7 @@ ACMD_FUNC(dye) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) { - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).", MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); + sprintf(atcmd_output, "Please, enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>).", MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); clif_displaymessage(fd, atcmd_output); return -1; } @@ -2111,7 +2111,7 @@ ACMD_FUNC(hair_style) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) { - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).", MIN_HAIR_STYLE, MAX_HAIR_STYLE); + sprintf(atcmd_output, "Please, enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>).", MIN_HAIR_STYLE, MAX_HAIR_STYLE); clif_displaymessage(fd, atcmd_output); return -1; } @@ -2138,7 +2138,7 @@ ACMD_FUNC(hair_color) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) { - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).", MIN_HAIR_COLOR, MAX_HAIR_COLOR); + sprintf(atcmd_output, "Please, enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>).", MIN_HAIR_COLOR, MAX_HAIR_COLOR); clif_displaymessage(fd, atcmd_output); return -1; } @@ -2399,7 +2399,7 @@ ACMD_FUNC(monster) if (number == count) clif_displaymessage(fd, msg_txt(39)); // All monster summoned! else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(240), count); // %d monster(s) summoned! + sprintf(atcmd_output, msg_txt(240), count); // %d monster(s) summoned! clif_displaymessage(fd, atcmd_output); } else { @@ -2635,25 +2635,25 @@ ACMD_FUNC(refine) if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) { clif_displaymessage(fd, "Please, enter a position and an amount (usage: @refine <equip position> <+/- amount>)."); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Lower Headgear", EQP_HEAD_LOW); + sprintf(atcmd_output, "%d: Lower Headgear", EQP_HEAD_LOW); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Right Hand", EQP_HAND_R); + sprintf(atcmd_output, "%d: Right Hand", EQP_HAND_R); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Garment", EQP_GARMENT); + sprintf(atcmd_output, "%d: Garment", EQP_GARMENT); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Left Accessory", EQP_ACC_L); + sprintf(atcmd_output, "%d: Left Accessory", EQP_ACC_L); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Body Armor", EQP_ARMOR); + sprintf(atcmd_output, "%d: Body Armor", EQP_ARMOR); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Left Hand", EQP_HAND_L); + sprintf(atcmd_output, "%d: Left Hand", EQP_HAND_L); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Shoes", EQP_SHOES); + sprintf(atcmd_output, "%d: Shoes", EQP_SHOES); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Right Accessory", EQP_ACC_R); + sprintf(atcmd_output, "%d: Right Accessory", EQP_ACC_R); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Top Headgear", EQP_HEAD_TOP); + sprintf(atcmd_output, "%d: Top Headgear", EQP_HEAD_TOP); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "%d: Mid Headgear", EQP_HEAD_MID); + sprintf(atcmd_output, "%d: Mid Headgear", EQP_HEAD_MID); clif_displaymessage(fd, atcmd_output); return -1; } @@ -2693,7 +2693,7 @@ ACMD_FUNC(refine) else if (count == 1) clif_displaymessage(fd, msg_txt(167)); // 1 item has been refined. else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(168), count); // %d items have been refined. + sprintf(atcmd_output, msg_txt(168), count); // %d items have been refined. clif_displaymessage(fd, atcmd_output); } @@ -2755,7 +2755,7 @@ ACMD_FUNC(produce) if ((flag = pc_additem(sd, &tmp_item, 1))) clif_additem(sd, 0, 0, flag); } else { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable. + sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable. clif_displaymessage(fd, atcmd_output); return -1; } @@ -2780,9 +2780,9 @@ ACMD_FUNC(memo) for( i = 0; i < MAX_MEMOPOINTS; i++ ) { if( sd->status.memo_point[i].map ) - snprintf(atcmd_output, sizeof atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y); + sprintf(atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y); else - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(171), i); // %d - void + sprintf(atcmd_output, msg_txt(171), i); // %d - void clif_displaymessage(sd->fd, atcmd_output); } return 0; @@ -2790,7 +2790,7 @@ ACMD_FUNC(memo) if( position < 0 || position >= MAX_MEMOPOINTS ) { - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter a valid position (usage: @memo <memo_position:%d-%d>).", 0, MAX_MEMOPOINTS-1); + sprintf(atcmd_output, "Please, enter a valid position (usage: @memo <memo_position:%d-%d>).", 0, MAX_MEMOPOINTS-1); clif_displaymessage(fd, atcmd_output); return -1; } @@ -2810,7 +2810,7 @@ ACMD_FUNC(gat) memset(atcmd_output, '\0', sizeof(atcmd_output)); for (y = 2; y >= -2; y--) { - snprintf(atcmd_output, sizeof atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X", + sprintf(atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X", map[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y, map_getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE), @@ -2989,7 +2989,7 @@ ACMD_FUNC(param) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) { - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustment>)."); + sprintf(atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustment>)."); clif_displaymessage(fd, atcmd_output); return -1; } @@ -2997,7 +2997,7 @@ ACMD_FUNC(param) ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 ); if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible... - snprintf(atcmd_output, sizeof atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustment>)."); + sprintf(atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustment>)."); clif_displaymessage(fd, atcmd_output); return -1; } @@ -3330,7 +3330,7 @@ ACMD_FUNC(recall) return -1; } pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled! + sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled! clif_displaymessage(fd, atcmd_output); return 0; @@ -3940,19 +3940,19 @@ ACMD_FUNC(idsearch) return -1; } - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(77), item_name); // The reference result of '%s' (name: id): + sprintf(atcmd_output, msg_txt(77), item_name); // The reference result of '%s' (name: id): clif_displaymessage(fd, atcmd_output); match = itemdb_searchname_array(item_array, MAX_SEARCH, item_name); if (match > MAX_SEARCH) { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(269), MAX_SEARCH, match); + sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, match); clif_displaymessage(fd, atcmd_output); match = MAX_SEARCH; } for(i = 0; i < match; i++) { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(78), item_array[i]->jname, item_array[i]->nameid); // %s: %d + sprintf(atcmd_output, msg_txt(78), item_array[i]->jname, item_array[i]->nameid); // %s: %d clif_displaymessage(fd, atcmd_output); } - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(79), match); // It is %d affair above. + sprintf(atcmd_output, msg_txt(79), match); // It is %d affair above. clif_displaymessage(fd, atcmd_output); return 0; @@ -3996,7 +3996,7 @@ ACMD_FUNC(recallall) clif_displaymessage(fd, msg_txt(92)); // All characters recalled! if (count) { - snprintf(atcmd_output, sizeof atcmd_output, "Because you are not authorised to warp from some maps, %d player(s) have not been recalled.", count); + sprintf(atcmd_output, "Because you are not authorised to warp from some maps, %d player(s) have not been recalled.", count); clif_displaymessage(fd, atcmd_output); } @@ -4052,10 +4052,10 @@ ACMD_FUNC(guildrecall) } mapit_free(iter); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(93), g->name); // All online characters of the %s guild have been recalled to your position. + sprintf(atcmd_output, msg_txt(93), g->name); // All online characters of the %s guild have been recalled to your position. clif_displaymessage(fd, atcmd_output); if (count) { - snprintf(atcmd_output, sizeof atcmd_output, "Because you are not authorised to warp from some maps, %d player(s) have not been recalled.", count); + sprintf(atcmd_output, "Because you are not authorised to warp from some maps, %d player(s) have not been recalled.", count); clif_displaymessage(fd, atcmd_output); } @@ -4111,10 +4111,10 @@ ACMD_FUNC(partyrecall) } mapit_free(iter); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(95), p->party.name); // All online characters of the %s party have been recalled to your position. + sprintf(atcmd_output, msg_txt(95), p->party.name); // All online characters of the %s party have been recalled to your position. clif_displaymessage(fd, atcmd_output); if (count) { - snprintf(atcmd_output, sizeof atcmd_output, "Because you are not authorised to warp from some maps, %d player(s) have not been recalled.", count); + sprintf(atcmd_output, "Because you are not authorised to warp from some maps, %d player(s) have not been recalled.", count); clif_displaymessage(fd, atcmd_output); } @@ -4322,7 +4322,7 @@ ACMD_FUNC(mapinfo) chat_num++; mapit_free(iter); - snprintf(atcmd_output, sizeof atcmd_output, "Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d", mapname, map[m_id].users, map[m_id].npc_num, chat_num); + sprintf(atcmd_output, "Map Name: %s | Players In Map: %d | NPCs In Map: %d | Chats In Map: %d", mapname, map[m_id].users, map[m_id].npc_num, chat_num); clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, "------ Map Flags ------"); if (map[m_id].flag.town) @@ -4377,16 +4377,16 @@ ACMD_FUNC(mapinfo) strcat(atcmd_output, "NoMemo | "); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "No Exp Penalty: %s | No Zeny Penalty: %s", (map[m_id].flag.noexppenalty) ? "On" : "Off", (map[m_id].flag.nozenypenalty) ? "On" : "Off"); + sprintf(atcmd_output, "No Exp Penalty: %s | No Zeny Penalty: %s", (map[m_id].flag.noexppenalty) ? "On" : "Off", (map[m_id].flag.nozenypenalty) ? "On" : "Off"); clif_displaymessage(fd, atcmd_output); if (map[m_id].flag.nosave) { if (!map[m_id].save.map) - snprintf(atcmd_output, sizeof atcmd_output, "No Save (Return to last Save Point)"); + sprintf(atcmd_output, "No Save (Return to last Save Point)"); else if (map[m_id].save.x == -1 || map[m_id].save.y == -1 ) - snprintf(atcmd_output, sizeof atcmd_output, "No Save, Save Point: %s,Random",mapindex_id2name(map[m_id].save.map)); + sprintf(atcmd_output, "No Save, Save Point: %s,Random",mapindex_id2name(map[m_id].save.map)); else - snprintf(atcmd_output, sizeof atcmd_output, "No Save, Save Point: %s,%d,%d", + sprintf(atcmd_output, "No Save, Save Point: %s,%d,%d", mapindex_id2name(map[m_id].save.map),map[m_id].save.x,map[m_id].save.y); clif_displaymessage(fd, atcmd_output); } @@ -4456,7 +4456,7 @@ ACMD_FUNC(mapinfo) for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (pl_sd->mapindex == m_index) { - snprintf(atcmd_output, sizeof atcmd_output, "Player '%s' (session #%d) | Location: %d,%d", + sprintf(atcmd_output, "Player '%s' (session #%d) | Location: %d,%d", pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y); clif_displaymessage(fd, atcmd_output); } @@ -4480,7 +4480,7 @@ ACMD_FUNC(mapinfo) case 9: strcpy(direction, "North"); break; default: strcpy(direction, "Unknown"); break; } - snprintf(atcmd_output, sizeof atcmd_output, "NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d", + sprintf(atcmd_output, "NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d", ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y); clif_displaymessage(fd, atcmd_output); } @@ -4494,10 +4494,10 @@ ACMD_FUNC(mapinfo) pl_sd->mapindex == m_index && cd->usersd[0] == pl_sd) { - snprintf(atcmd_output, sizeof atcmd_output, "Chat: %s | Player: %s | Location: %d %d", + sprintf(atcmd_output, "Chat: %s | Player: %s | Location: %d %d", cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, " Users: %d/%d | Password: %s | Public: %s", + sprintf(atcmd_output, " Users: %d/%d | Password: %s | Public: %s", cd->users, cd->limit, cd->pass, (cd->pub) ? "Yes" : "No"); clif_displaymessage(fd, atcmd_output); } @@ -4569,11 +4569,11 @@ ACMD_FUNC(guildspy) (g = guild_search(atoi(message))) != NULL) { if (sd->guildspy == g->guild_id) { sd->guildspy = 0; - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(103), g->name); // No longer spying on the %s guild. + sprintf(atcmd_output, msg_txt(103), g->name); // No longer spying on the %s guild. clif_displaymessage(fd, atcmd_output); } else { sd->guildspy = g->guild_id; - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(104), g->name); // Spying on the %s guild. + sprintf(atcmd_output, msg_txt(104), g->name); // Spying on the %s guild. clif_displaymessage(fd, atcmd_output); } } else { @@ -4611,11 +4611,11 @@ ACMD_FUNC(partyspy) (p = party_search(atoi(message))) != NULL) { if (sd->partyspy == p->party.party_id) { sd->partyspy = 0; - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(105), p->party.name); // No longer spying on the %s party. + sprintf(atcmd_output, msg_txt(105), p->party.name); // No longer spying on the %s party. clif_displaymessage(fd, atcmd_output); } else { sd->partyspy = p->party.party_id; - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(106), p->party.name); // Spying on the %s party. + sprintf(atcmd_output, msg_txt(106), p->party.name); // Spying on the %s party. clif_displaymessage(fd, atcmd_output); } } else { @@ -4838,21 +4838,21 @@ char* txt_time(unsigned int duration) seconds = duration - (60 * minutes); if (days < 2) - snprintf(temp, sizeof temp, msg_txt(219), days); // %d day + sprintf(temp, msg_txt(219), days); // %d day else - snprintf(temp, sizeof temp, msg_txt(220), days); // %d days + sprintf(temp, msg_txt(220), days); // %d days if (hours < 2) - snprintf(temp1, sizeof temp1, msg_txt(221), temp, hours); // %s %d hour + sprintf(temp1, msg_txt(221), temp, hours); // %s %d hour else - snprintf(temp1, sizeof temp1, msg_txt(222), temp, hours); // %s %d hours + sprintf(temp1, msg_txt(222), temp, hours); // %s %d hours if (minutes < 2) - snprintf(temp, sizeof temp, msg_txt(223), temp1, minutes); // %s %d minute + sprintf(temp, msg_txt(223), temp1, minutes); // %s %d minute else - snprintf(temp, sizeof temp, msg_txt(224), temp1, minutes); // %s %d minutes + sprintf(temp, msg_txt(224), temp1, minutes); // %s %d minutes if (seconds < 2) - snprintf(temp1, sizeof temp1, msg_txt(225), temp, seconds); // %s and %d second + sprintf(temp1, msg_txt(225), temp, seconds); // %s and %d second else - snprintf(temp1, sizeof temp1, msg_txt(226), temp, seconds); // %s and %d seconds + sprintf(temp1, msg_txt(226), temp, seconds); // %s and %d seconds return temp1; } @@ -4874,7 +4874,7 @@ ACMD_FUNC(servertime) time(&time_server); // get time in seconds since 1/1/1970 datetime = localtime(&time_server); // convert seconds in structure - // like snprintf, but only for date/time (Sunday, November 02 2003 15:12:52) + // like sprintf, but only for date/time (Sunday, November 02 2003 15:12:52) strftime(temp, sizeof(temp)-1, msg_txt(230), datetime); // Server time (normal time): %A, %B %d %Y %X. clif_displaymessage(fd, temp); @@ -4886,7 +4886,7 @@ ACMD_FUNC(servertime) } else if (battle_config.night_duration == 0) if (night_flag == 1) { // we start with night timer_data = get_timer(day_timer_tid); - snprintf(temp, sizeof temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in night for %s. + sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in night for %s. clif_displaymessage(fd, temp); clif_displaymessage(fd, msg_txt(234)); // Game time: After, the game will be in permanent daylight. } else @@ -4894,7 +4894,7 @@ ACMD_FUNC(servertime) else if (battle_config.day_duration == 0) if (night_flag == 0) { // we start with day timer_data = get_timer(night_timer_tid); - snprintf(temp, sizeof temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. + sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. clif_displaymessage(fd, temp); clif_displaymessage(fd, msg_txt(236)); // Game time: After, the game will be in permanent night. } else @@ -4903,26 +4903,26 @@ ACMD_FUNC(servertime) if (night_flag == 0) { timer_data = get_timer(night_timer_tid); timer_data2 = get_timer(day_timer_tid); - snprintf(temp, sizeof temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. + sprintf(temp, msg_txt(235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is actualy in daylight for %s. clif_displaymessage(fd, temp); if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0) - snprintf(temp, sizeof temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s. + sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s. else - snprintf(temp, sizeof temp, msg_txt(237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s. + sprintf(temp, msg_txt(237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s. clif_displaymessage(fd, temp); - snprintf(temp, sizeof temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. + sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. clif_displaymessage(fd, temp); } else { timer_data = get_timer(day_timer_tid); timer_data2 = get_timer(night_timer_tid); - snprintf(temp, sizeof temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s. + sprintf(temp, msg_txt(233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is actualy in night for %s. clif_displaymessage(fd, temp); if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0) - snprintf(temp, sizeof temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s. + sprintf(temp, msg_txt(239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s. else - snprintf(temp, sizeof temp, msg_txt(239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s. + sprintf(temp, msg_txt(239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s. clif_displaymessage(fd, temp); - snprintf(temp, sizeof temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. + sprintf(temp, msg_txt(238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. clif_displaymessage(fd, temp); } } @@ -5136,9 +5136,9 @@ ACMD_FUNC(jailfor) clif_displaymessage(fd, msg_txt(121)); // Player unjailed } else { get_jail_time(jailtime,&year,&month,&day,&hour,&minute); - snprintf(atcmd_output, sizeof atcmd_output,msg_txt(402),"You are now",year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes + sprintf(atcmd_output,msg_txt(402),"You are now",year,month,day,hour,minute); //%s in jail for %d years, %d months, %d days, %d hours and %d minutes clif_displaymessage(pl_sd->fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output,msg_txt(402),"This player is now",year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes + sprintf(atcmd_output,msg_txt(402),"This player is now",year,month,day,hour,minute); //This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes clif_displaymessage(fd, atcmd_output); } } else if (jailtime < 0) { @@ -5188,7 +5188,7 @@ ACMD_FUNC(jailtime) //Get remaining jail time get_jail_time(sd->sc.data[SC_JAILED]->val1,&year,&month,&day,&hour,&minute); - snprintf(atcmd_output, sizeof atcmd_output,msg_txt(402),"You will remain",year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes + sprintf(atcmd_output,msg_txt(402),"You will remain",year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes clif_displaymessage(fd, atcmd_output); @@ -5327,7 +5327,7 @@ ACMD_FUNC(exp) if (nextj) nextj = sd->status.job_exp*100.0/nextj; - snprintf(output, sizeof output, "Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)", sd->status.base_level, nextb, sd->status.job_level, nextj); + sprintf(output, "Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)", sd->status.base_level, nextb, sd->status.job_level, nextj); clif_displaymessage(fd, output); return 0; } @@ -5347,7 +5347,7 @@ ACMD_FUNC(broadcast) return -1; } - snprintf(atcmd_output, sizeof atcmd_output, "%s: %s", sd->status.name, message); + sprintf(atcmd_output, "%s: %s", sd->status.name, message); intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, 0); return 0; @@ -5367,7 +5367,7 @@ ACMD_FUNC(localbroadcast) return -1; } - snprintf(atcmd_output, sizeof atcmd_output, "%s: %s", sd->status.name, message); + sprintf(atcmd_output, "%s: %s", sd->status.name, message); clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, 0, ALL_SAMEMAP); @@ -5547,7 +5547,7 @@ ACMD_FUNC(addwarp) m = mapindex_name2id(mapname); if( m == 0 ) { - snprintf(atcmd_output, sizeof atcmd_output, "Unknown map '%s'.", mapname); + sprintf(atcmd_output, "Unknown map '%s'.", mapname); clif_displaymessage(fd, atcmd_output); return -1; } @@ -5556,7 +5556,7 @@ ACMD_FUNC(addwarp) if( nd == NULL ) return -1; - snprintf(atcmd_output, sizeof atcmd_output, "New warp NPC '%s' created.", nd->exname); + sprintf(atcmd_output, "New warp NPC '%s' created.", nd->exname); clif_displaymessage(fd, atcmd_output); return 0; } @@ -5665,7 +5665,7 @@ ACMD_FUNC(skillid) for (idx = 0; idx < MAX_SKILL_DB; idx++) { if (strnicmp(skill_db[idx].name, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) { - snprintf(atcmd_output, sizeof atcmd_output, "skill %d: %s", idx, skill_db[idx].desc); + sprintf(atcmd_output, "skill %d: %s", idx, skill_db[idx].desc); clif_displaymessage(fd, atcmd_output); } } @@ -5772,13 +5772,13 @@ ACMD_FUNC(skilltree) tbl = job_name(c); - snprintf(atcmd_output, sizeof atcmd_output, "Player is using %s skill tree (%d basic points)", tbl, pc_checkskill(pl_sd, 1)); + sprintf(atcmd_output, "Player is using %s skill tree (%d basic points)", tbl, pc_checkskill(pl_sd, 1)); clif_displaymessage(fd, atcmd_output); ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skillnum ); if( j == MAX_SKILL_TREE || skill_tree[c][j].id == 0 ) { - snprintf(atcmd_output, sizeof atcmd_output, "I do not believe the player can use that skill"); + sprintf(atcmd_output, "I do not believe the player can use that skill"); clif_displaymessage(fd, atcmd_output); return 0; } @@ -5790,13 +5790,13 @@ ACMD_FUNC(skilltree) { if( ent->need[j].id && pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv) { - snprintf(atcmd_output, sizeof atcmd_output, "player requires level %d of skill %s", ent->need[j].lv, skill_db[ent->need[j].id].desc); + sprintf(atcmd_output, "player requires level %d of skill %s", ent->need[j].lv, skill_db[ent->need[j].id].desc); clif_displaymessage(fd, atcmd_output); meets = 0; } } if (meets == 1) { - snprintf(atcmd_output, sizeof atcmd_output, "I believe the player meets all the requirements for that skill"); + sprintf(atcmd_output, "I believe the player meets all the requirements for that skill"); clif_displaymessage(fd, atcmd_output); } @@ -5845,13 +5845,13 @@ ACMD_FUNC(marry) } if((pl_sd1=map_nick2sd((char *) player1)) == NULL) { - snprintf(player2, sizeof player2, "Cannot find player '%s' online", player1); + sprintf(player2, "Cannot find player '%s' online", player1); clif_displaymessage(fd, player2); return -1; } if((pl_sd2=map_nick2sd((char *) player2)) == NULL) { - snprintf(player1, sizeof player1, "Cannot find player '%s' online", player2); + sprintf(player1, "Cannot find player '%s' online", player2); clif_displaymessage(fd, player1); return -1; } @@ -5891,12 +5891,12 @@ ACMD_FUNC(divorce) } if (pc_divorce(pl_sd) != 0) { - snprintf(atcmd_output, sizeof atcmd_output, "The divorce has failed.. Cannot find player '%s' or his(her) partner online.", atcmd_player_name); + sprintf(atcmd_output, "The divorce has failed.. Cannot find player '%s' or his(her) partner online.", atcmd_player_name); clif_displaymessage(fd, atcmd_output); return -1; } - snprintf(atcmd_output, sizeof atcmd_output, "'%s' and his(her) partner are now divorced.", atcmd_player_name); + sprintf(atcmd_output, "'%s' and his(her) partner are now divorced.", atcmd_player_name); clif_displaymessage(fd, atcmd_output); return 0; } @@ -6122,7 +6122,7 @@ ACMD_FUNC(autolootitem) sd->state.autolootid = item_data->nameid; // Autoloot Activated - snprintf(atcmd_output, sizeof atcmd_output, "Autolooting Item: '%s'/'%s' {%d}", + sprintf(atcmd_output, "Autolooting Item: '%s'/'%s' {%d}", item_data->name, item_data->jname, item_data->nameid); clif_displaymessage(fd, atcmd_output); @@ -6540,7 +6540,7 @@ ACMD_FUNC(reset) { pc_resetstate(sd); pc_resetskill(sd,1); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(208), sd->status.name); // '%s' skill and stats points reseted! + sprintf(atcmd_output, msg_txt(208), sd->status.name); // '%s' skill and stats points reseted! clif_displaymessage(fd, atcmd_output); return 0; } @@ -6946,7 +6946,7 @@ ACMD_FUNC(mobinfo) } if (count > MAX_SEARCH) { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(269), MAX_SEARCH, count); + sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } @@ -6955,18 +6955,18 @@ ACMD_FUNC(mobinfo) // stats if (mob->mexp) - snprintf(atcmd_output, sizeof atcmd_output, "MVP Monster: '%s'/'%s'/'%s' (%d)", mob->name, mob->jname, mob->sprite, mob->vd.class_); + sprintf(atcmd_output, "MVP Monster: '%s'/'%s'/'%s' (%d)", mob->name, mob->jname, mob->sprite, mob->vd.class_); else - snprintf(atcmd_output, sizeof atcmd_output, "Monster: '%s'/'%s'/'%s' (%d)", mob->name, mob->jname, mob->sprite, mob->vd.class_); + sprintf(atcmd_output, "Monster: '%s'/'%s'/'%s' (%d)", mob->name, mob->jname, mob->sprite, mob->vd.class_); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, " Level:%d HP:%d SP:%d Base EXP:%u Job EXP:%u", mob->lv, mob->status.max_hp, mob->status.max_sp, mob->base_exp, mob->job_exp); + sprintf(atcmd_output, " Level:%d HP:%d SP:%d Base EXP:%u Job EXP:%u", mob->lv, mob->status.max_hp, mob->status.max_sp, mob->base_exp, mob->job_exp); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, " DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d", + sprintf(atcmd_output, " DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d", mob->status.def, mob->status.mdef, mob->status.str, mob->status.agi, mob->status.vit, mob->status.int_, mob->status.dex, mob->status.luk); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, " ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d)", + sprintf(atcmd_output, " ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d)", mob->status.rhw.atk, mob->status.rhw.atk2, mob->status.rhw.range, mob->range2 , mob->range3, msize[mob->status.size], mrace[mob->status.race], melement[mob->status.def_ele], mob->status.ele_lv); @@ -6979,9 +6979,9 @@ ACMD_FUNC(mobinfo) if (mob->dropitem[i].nameid <= 0 || mob->dropitem[i].p < 1 || (item_data = itemdb_search(mob->dropitem[i].nameid)) == NULL) continue; if (item_data->slot) - snprintf(atcmd_output2, sizeof atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)mob->dropitem[i].p / 100); + sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)mob->dropitem[i].p / 100); else - snprintf(atcmd_output2, sizeof atcmd_output2, " - %s %02.02f%%", item_data->jname, (float)mob->dropitem[i].p / 100); + sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, (float)mob->dropitem[i].p / 100); strcat(atcmd_output, atcmd_output2); if (++j % 3 == 0) { clif_displaymessage(fd, atcmd_output); @@ -6994,7 +6994,7 @@ ACMD_FUNC(mobinfo) clif_displaymessage(fd, atcmd_output); // mvp if (mob->mexp) { - snprintf(atcmd_output, sizeof atcmd_output, " MVP Bonus EXP:%u %02.02f%%", mob->mexp, (float)mob->mexpper / 100); + sprintf(atcmd_output, " MVP Bonus EXP:%u %02.02f%%", mob->mexp, (float)mob->mexpper / 100); clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output, " MVP Items:"); j = 0; @@ -7004,9 +7004,9 @@ ACMD_FUNC(mobinfo) if (mob->mvpitem[i].p > 0) { j++; if (j == 1) - snprintf(atcmd_output2, sizeof atcmd_output2, " %s %02.02f%%", item_data->name, (float)mob->mvpitem[i].p / 100); + sprintf(atcmd_output2, " %s %02.02f%%", item_data->name, (float)mob->mvpitem[i].p / 100); else - snprintf(atcmd_output2, sizeof atcmd_output2, " - %s %02.02f%%", item_data->name, (float)mob->mvpitem[i].p / 100); + sprintf(atcmd_output2, " - %s %02.02f%%", item_data->name, (float)mob->mvpitem[i].p / 100); strcat(atcmd_output, atcmd_output2); } } @@ -7406,26 +7406,26 @@ ACMD_FUNC(iteminfo) } if (count > MAX_SEARCH) { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches + sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } for (i = 0; i < count; i++) { item_data = item_array[i]; - snprintf(atcmd_output, sizeof atcmd_output, "Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s", + sprintf(atcmd_output, "Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s", item_data->name,item_data->jname,item_data->slot,item_data->nameid, itemdb_typename(item_data->type), (item_data->script==NULL)? "None" : "With script" ); clif_displaymessage(fd, atcmd_output); - snprintf(atcmd_output, sizeof atcmd_output, "NPC Buy:%dz, Sell:%dz | Weight: %.1f ", item_data->value_buy, item_data->value_sell, item_data->weight/10. ); + sprintf(atcmd_output, "NPC Buy:%dz, Sell:%dz | Weight: %.1f ", item_data->value_buy, item_data->value_sell, item_data->weight/10. ); clif_displaymessage(fd, atcmd_output); if (item_data->maxchance == 10000) strcpy(atcmd_output, " - Available in the shops only"); else if (item_data->maxchance) - snprintf(atcmd_output, sizeof atcmd_output, " - Maximal monsters drop chance: %02.02f%%", (float)item_data->maxchance / 100 ); + sprintf(atcmd_output, " - Maximal monsters drop chance: %02.02f%%", (float)item_data->maxchance / 100 ); else strcpy(atcmd_output, " - Monsters don't drop this item"); clif_displaymessage(fd, atcmd_output); @@ -7455,25 +7455,25 @@ ACMD_FUNC(whodrops) } if (count > MAX_SEARCH) { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches + sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } for (i = 0; i < count; i++) { item_data = item_array[i]; - snprintf(atcmd_output, sizeof atcmd_output, "Item: '%s'[%d]", item_data->jname,item_data->slot); + sprintf(atcmd_output, "Item: '%s'[%d]", item_data->jname,item_data->slot); clif_displaymessage(fd, atcmd_output); if (item_data->mob[0].chance == 0) { strcpy(atcmd_output, " - Item is not dropped by mobs."); clif_displaymessage(fd, atcmd_output); } else { - snprintf(atcmd_output, sizeof atcmd_output, "- Common mobs with highest drop chance (only max %d are listed):", MAX_SEARCH); + sprintf(atcmd_output, "- Common mobs with highest drop chance (only max %d are listed):", MAX_SEARCH); clif_displaymessage(fd, atcmd_output); for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++) { - snprintf(atcmd_output, sizeof atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.); + sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.); clif_displaymessage(fd, atcmd_output); } } @@ -7506,7 +7506,7 @@ ACMD_FUNC(whereis) } if (count > MAX_SEARCH) { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(269), MAX_SEARCH, count); + sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } @@ -7550,19 +7550,19 @@ ACMD_FUNC(adopt) ShowInfo("Adopting: --%s--%s--%s--\n",player1,player2,player3); if((pl_sd1=map_nick2sd((char *) player1)) == NULL) { - snprintf(output, sizeof output, "Cannot find player %s online", player1); + sprintf(output, "Cannot find player %s online", player1); clif_displaymessage(fd, output); return -1; } if((pl_sd2=map_nick2sd((char *) player2)) == NULL) { - snprintf(output, sizeof output, "Cannot find player %s online", player2); + sprintf(output, "Cannot find player %s online", player2); clif_displaymessage(fd, output); return -1; } if((pl_sd3=map_nick2sd((char *) player3)) == NULL) { - snprintf(output, sizeof output, "Cannot find player %s online", player3); + sprintf(output, "Cannot find player %s online", player3); clif_displaymessage(fd, output); return -1; } @@ -7580,7 +7580,7 @@ ACMD_FUNC(version) const char * revision; if ((revision = get_svn_revision()) != 0) { - snprintf(atcmd_output, sizeof atcmd_output,"eAthena Version SVN r%s",revision); + sprintf(atcmd_output,"eAthena Version SVN r%s",revision); clif_displaymessage(fd,atcmd_output); } else clif_displaymessage(fd,"Cannot determine SVN revision"); @@ -7677,7 +7677,7 @@ ACMD_FUNC(me) return -1; } - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(270), sd->status.name, tempmes); // *%s %s* + sprintf(atcmd_output, msg_txt(270), sd->status.name, tempmes); // *%s %s* clif_disp_overhead(sd, atcmd_output); return 0; @@ -7858,7 +7858,7 @@ ACMD_FUNC(invite) if(battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m) { - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(364), message); + sprintf(atcmd_output, msg_txt(364), message); clif_displaymessage(fd, atcmd_output); return 0; } @@ -7888,7 +7888,7 @@ ACMD_FUNC(duel) if(!duel_checktime(sd)) { // "Duel: You can take part in duel only one time per %d minutes." - snprintf(output, sizeof output, msg_txt(356), battle_config.duel_time_interval); + sprintf(output, msg_txt(356), battle_config.duel_time_interval); clif_displaymessage(fd, output); return 0; } @@ -7943,7 +7943,7 @@ ACMD_FUNC(accept) if(!duel_checktime(sd)) { // "Duel: You can take part in duel only one time per %d minutes." - snprintf(output, sizeof output, msg_txt(356), battle_config.duel_time_interval); + sprintf(output, msg_txt(356), battle_config.duel_time_interval); clif_displaymessage(fd, output); return 0; } @@ -8111,7 +8111,7 @@ ACMD_FUNC(main) clif_displaymessage(fd, msg_txt(387)); return -1; } - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(386), sd->status.name, message); + sprintf(atcmd_output, msg_txt(386), sd->status.name, message); // I use 0xFE000000 color for signalizing that this message is // main chat message. 0xFE000000 is invalid color, same using // 0xFF000000 for simple (not colored) GM messages. [LuzZza] @@ -8160,7 +8160,7 @@ ACMD_FUNC(request) return -1; } - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(278), message); // (@request): %s + sprintf(atcmd_output, msg_txt(278), message); // (@request): %s intif_wis_message_to_gm(sd->status.name, battle_config.lowest_gm_level, atcmd_output); clif_disp_onlyself(sd, atcmd_output, strlen(atcmd_output)); clif_displaymessage(sd->fd,msg_txt(279)); // @request sent. @@ -8201,27 +8201,27 @@ ACMD_FUNC(ksprotection) if( sd->state.noks ) { sd->state.noks = 0; - snprintf(atcmd_output, sizeof atcmd_output, "[ K.S Protection Inactive ]"); + sprintf(atcmd_output, "[ K.S Protection Inactive ]"); } else { if( !message || !*message || !strcmpi(message, "party") ) { // Default is Party sd->state.noks = 2; - snprintf(atcmd_output, sizeof atcmd_output, "[ K.S Protection Active - Option: Party ]"); + sprintf(atcmd_output, "[ K.S Protection Active - Option: Party ]"); } else if( !strcmpi(message, "self") ) { sd->state.noks = 1; - snprintf(atcmd_output, sizeof atcmd_output, "[ K.S Protection Active - Option: Self ]"); + sprintf(atcmd_output, "[ K.S Protection Active - Option: Self ]"); } else if( !strcmpi(message, "guild") ) { sd->state.noks = 3; - snprintf(atcmd_output, sizeof atcmd_output, "[ K.S Protection Active - Option: Guild ]"); + sprintf(atcmd_output, "[ K.S Protection Active - Option: Guild ]"); } else - snprintf(atcmd_output, sizeof atcmd_output, "Usage: @noks <self|party|guild>"); + sprintf(atcmd_output, "Usage: @noks <self|party|guild>"); } clif_displaymessage(fd, atcmd_output); @@ -8236,10 +8236,10 @@ ACMD_FUNC(allowks) if( map[sd->bl.m].flag.allowks ) { map[sd->bl.m].flag.allowks = 0; - snprintf(atcmd_output, sizeof atcmd_output, "[ Map K.S Protection Active ]"); + sprintf(atcmd_output, "[ Map K.S Protection Active ]"); } else { map[sd->bl.m].flag.allowks = 1; - snprintf(atcmd_output, sizeof atcmd_output, "[ Map K.S Protection Inactive ]"); + sprintf(atcmd_output, "[ Map K.S Protection Inactive ]"); } clif_displaymessage(fd, atcmd_output); @@ -8251,7 +8251,7 @@ ACMD_FUNC(resetstat) nullpo_retr(-1, sd); pc_resetstate(sd); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(207), sd->status.name); + sprintf(atcmd_output, msg_txt(207), sd->status.name); clif_displaymessage(fd, atcmd_output); return 0; } @@ -8261,7 +8261,7 @@ ACMD_FUNC(resetskill) nullpo_retr(-1,sd); pc_resetskill(sd,1); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(206), sd->status.name); + sprintf(atcmd_output, msg_txt(206), sd->status.name); clif_displaymessage(fd, atcmd_output); return 0; } @@ -8480,13 +8480,13 @@ ACMD_FUNC(stats) output_table[13].value = sd->status.skill_point; output_table[14].value = sd->change_level; - snprintf(job_jobname, sizeof job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)"); - snprintf(output, sizeof output, msg_txt(53), sd->status.name); // '%s' stats: + sprintf(job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)"); + sprintf(output, msg_txt(53), sd->status.name); // '%s' stats: clif_displaymessage(fd, output); for (i = 0; output_table[i].format != NULL; i++) { - snprintf(output, sizeof output, output_table[i].format, output_table[i].value); + sprintf(output, output_table[i].format, output_table[i].value); clif_displaymessage(fd, output); } @@ -8532,12 +8532,12 @@ ACMD_FUNC(delitem) count++; item_position = pc_search_inventory(sd, item_id); // for next loop } - snprintf(output, sizeof output, msg_txt(113), count); // %d item(s) removed by a GM. + sprintf(output, msg_txt(113), count); // %d item(s) removed by a GM. clif_displaymessage(sd->fd, output); if (number == count) - snprintf(output, sizeof output, msg_txt(114), count); // %d item(s) removed from the player. + sprintf(output, msg_txt(114), count); // %d item(s) removed from the player. else - snprintf(output, sizeof output, msg_txt(115), count, count, number); // %d item(s) removed. Player had only %d on %d items. + sprintf(output, msg_txt(115), count, count, number); // %d item(s) removed. Player had only %d on %d items. clif_displaymessage(fd, output); } else { clif_displaymessage(fd, msg_txt(116)); // Character does not have the item. @@ -8988,7 +8988,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message if ( (ssd = map_nick2sd(charname)) == NULL && ( (ssd = map_nick2sd(charname2)) == NULL ) ) { - snprintf(output, sizeof output, "%s failed. Player not found.", command); + sprintf(output, "%s failed. Player not found.", command); clif_displaymessage(fd, output); return true; } @@ -8997,21 +8997,21 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message //can be looked at by the actual command function since most scan to see if the //right parameters are used. if ( x > 2 ) { - snprintf(atcmd_msg, sizeof atcmd_msg, "%s %s", command, params); + sprintf(atcmd_msg, "%s %s", command, params); break; } else if ( y > 2 ) { - snprintf(atcmd_msg, sizeof atcmd_msg, "%s %s", command, params2); + sprintf(atcmd_msg, "%s %s", command, params2); break; } //Regardless of what style the #command is used, if it's correct, it will always have //this value if there is no parameter. Send it as just the #command else if ( z == 2 ) { - snprintf(atcmd_msg, sizeof atcmd_msg, "%s", command); + sprintf(atcmd_msg, "%s", command); break; } - snprintf(output, sizeof output, "Charcommand failed. Usage: #<command> <char name> <params>."); + sprintf(output, "Charcommand failed. Usage: #<command> <char name> <params>."); clif_displaymessage(fd, output); return true; } @@ -9020,7 +9020,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message //atcmd_msg is constructed above differently for charcommands //it's copied from message if not a charcommand so it can //pass through the rest of the code compatible with both symbols - snprintf(atcmd_msg, sizeof atcmd_msg, "%s", message); + sprintf(atcmd_msg, "%s", message); } //Clearing these to be used once more. @@ -9035,7 +9035,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message info = get_atcommandinfo_byname(command); if( info == NULL || info->func == NULL || ( type && ((*atcmd_msg == atcommand_symbol && pc_isGM(sd) < info->level) || (*atcmd_msg == charcommand_symbol && pc_isGM(sd) < info->level2)) ) ) { - snprintf(output, sizeof output, msg_txt(153), command); // "%s is Unknown Command." + sprintf(output, msg_txt(153), command); // "%s is Unknown Command." clif_displaymessage(fd, output); return true; } @@ -9044,7 +9044,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message if( strcmpi("adjgmlvl",command+1) && ssd ) { lv = ssd->gmlevel; ssd->gmlevel = sd->gmlevel; } if ( (info->func(fd, (*atcmd_msg == atcommand_symbol) ? sd : ssd, command, params) != 0) ) { - snprintf(output, sizeof output, msg_txt(154), command); // %s failed. + sprintf(output,msg_txt(154), command); // %s failed. clif_displaymessage(fd, output); } if( strcmpi("adjgmlvl",command+1) && ssd ) ssd->gmlevel = lv; @@ -9182,7 +9182,7 @@ ACMD_FUNC(commands) } clif_displaymessage(fd,line_buff); - snprintf(atcmd_output, sizeof atcmd_output, msg_txt(274), count); // "%d commands found." + sprintf(atcmd_output, msg_txt(274), count); // "%d commands found." clif_displaymessage(fd, atcmd_output); return 0; diff --git a/src/map/battleground.c b/src/map/battleground.c index 0adacec53..1c2a90d90 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -127,9 +127,9 @@ int bg_team_leave(struct map_session_data *sd, int flag) bg->count--; if( flag ) - snprintf(output, sizeof output, "Server : %s has quit the game...", sd->status.name); + sprintf(output, "Server : %s has quit the game...", sd->status.name); else - snprintf(output, sizeof output, "Server : %s is leaving the battlefield...", sd->status.name); + sprintf(output, "Server : %s is leaving the battlefield...", sd->status.name); clif_bg_message(bg, "Server", output, strlen(output) + 1); if( bg->logout_event[0] && flag ) diff --git a/src/map/chrif.c b/src/map/chrif.c index 04953bdbe..40e7ca8d1 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -806,10 +806,10 @@ static void chrif_char_ask_name_answer(int acc, const char* player_name, uint16 } switch( answer ) { - case 0 : snprintf(output, sizeof output, "Login-server has been asked to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; - case 1 : snprintf(output, sizeof output, "The player '%.*s' doesn't exist.", NAME_LENGTH, player_name); break; - case 2 : snprintf(output, sizeof output, "Your GM level don't authorise you to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; - case 3 : snprintf(output, sizeof output, "Login-server is offline. Impossible to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; + case 0 : sprintf(output, "Login-server has been asked to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; + case 1 : sprintf(output, "The player '%.*s' doesn't exist.", NAME_LENGTH, player_name); break; + case 2 : sprintf(output, "Your GM level don't authorise you to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; + case 3 : sprintf(output, "Login-server is offline. Impossible to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; default: output[0] = '\0'; break; } diff --git a/src/map/clif.c b/src/map/clif.c index 94b4e91f0..29064fe31 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7843,11 +7843,11 @@ int clif_charnameack (int fd, struct block_list *bl) char mobhp[50], *str_p = mobhp; WBUFW(buf, 0) = cmd = 0x195; if( battle_config.show_mob_info&4 ) - str_p += snprintf(str_p, sizeof str_p, "Lv. %d | ", md->level); + str_p += sprintf(str_p, "Lv. %d | ", md->level); if( battle_config.show_mob_info&1 ) - str_p += snprintf(str_p, sizeof str_p, "HP: %u/%u | ", md->status.hp, md->status.max_hp); + str_p += sprintf(str_p, "HP: %u/%u | ", md->status.hp, md->status.max_hp); if( battle_config.show_mob_info&2 ) - str_p += snprintf(str_p, sizeof str_p, "HP: %d%% | ", get_percentage(md->status.hp, md->status.max_hp)); + str_p += sprintf(str_p, "HP: %d%% | ", get_percentage(md->status.hp, md->status.max_hp)); //Even thought mobhp ain't a name, we send it as one so the client //can parse it. [Skotlex] if( str_p != mobhp ) @@ -8727,7 +8727,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if( map[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) ) { char output[128]; - snprintf(output, sizeof output, "[ Kill Steal Protection Disable. KS is allowed in this map ]"); + sprintf(output, "[ Kill Steal Protection Disable. KS is allowed in this map ]"); clif_broadcast(&sd->bl, output, strlen(output) + 1, 0x10, SELF); } @@ -8932,7 +8932,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) pc_isGM(sd) < battle_config.hack_info_GM_level ) { char gm_msg[256]; - snprintf(gm_msg, sizeof gm_msg, "Hack on NameRequest: character '%s' (account: %d) requested the name of an invisible target (id: %d).\n", sd->status.name, sd->status.account_id, id); + sprintf(gm_msg, "Hack on NameRequest: character '%s' (account: %d) requested the name of an invisible target (id: %d).\n", sd->status.name, sd->status.account_id, id); ShowWarning(gm_msg); // information is sent to all online GMs intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, gm_msg); @@ -9005,7 +9005,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) break; case 1: { char buf[256]; - snprintf(buf, sizeof buf, msg_txt(505), sd->status.name); + sprintf(buf, msg_txt(505), sd->status.name); if( strstr(message, buf) ) // "My name is %s, and I'm a Super Novice~" sd->state.snovice_call_flag++; } @@ -9049,11 +9049,11 @@ void clif_parse_MapMove(int fd, struct map_session_data *sd) map_name = (char*)RFIFOP(fd,2); map_name[MAP_NAME_LENGTH_EXT-1]='\0'; - snprintf(output, sizeof output, "%s %d %d", map_name, RFIFOW(fd,18), RFIFOW(fd,20)); + sprintf(output, "%s %d %d", map_name, RFIFOW(fd,18), RFIFOW(fd,20)); atcommand_mapmove(fd, sd, "@mapmove", output); if( log_config.gm && get_atcommand_level(atcommand_mapmove) >= log_config.gm ) { - snprintf(message, sizeof message, "/mm %s", output); + sprintf(message, "/mm %s", output); log_atcommand(sd, message); } return; @@ -9326,11 +9326,11 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) for( i = 0; i < 10; ++i ) { - snprintf(output, sizeof output, "@whispervar%d$", i); + sprintf(output, "@whispervar%d$", i); set_var(sd,output,(char *) split_data[i]); } - snprintf(output, sizeof output, "%s::OnWhisperGlobal", npc->name); + sprintf(output, "%s::OnWhisperGlobal", npc->name); npc_event(sd,output,0); // Calls the NPC label return; @@ -9390,7 +9390,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) if( dstsd->state.autotrade == 1 ) { char output[256]; - snprintf(output, sizeof output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name); + sprintf(output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name); clif_wis_message(fd, wisp_server_name, output, strlen(output) + 1); return; } @@ -9402,12 +9402,12 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) if(dstsd->away_message[0] != '\0') { char output[256]; - snprintf(output, sizeof output, "%s %s", message, msg_txt(543)); // "(Automessage has been sent)" + sprintf(output, "%s %s", message, msg_txt(543)); // "(Automessage has been sent)" clif_wis_message(dstsd->fd, sd->status.name, output, strlen(output) + 1); if(dstsd->state.autotrade) - snprintf(output, sizeof output, msg_txt(544), dstsd->away_message); // "Away [AT] - "%s"" + sprintf(output, msg_txt(544), dstsd->away_message); // "Away [AT] - "%s"" else - snprintf(output, sizeof output, msg_txt(545), dstsd->away_message); // "Away - "%s"" + sprintf(output, msg_txt(545), dstsd->away_message); // "Away - "%s"" clif_wis_message(fd, dstsd->status.name, output, strlen(output) + 1); return; } @@ -9438,7 +9438,7 @@ void clif_parse_Broadcast(int fd, struct map_session_data* sd) if(log_config.gm && lv >= log_config.gm) { char logmsg[CHAT_SIZE_MAX+4]; - snprintf(logmsg, sizeof logmsg, "/b %s", msg); + sprintf(logmsg, "/b %s", msg); log_atcommand(sd, logmsg); } } @@ -10528,7 +10528,7 @@ void clif_parse_LocalBroadcast(int fd, struct map_session_data* sd) if( log_config.gm && lv >= log_config.gm ) { char logmsg[CHAT_SIZE_MAX+5]; - snprintf(logmsg, sizeof logmsg, "/lb %s", msg); + sprintf(logmsg, "/lb %s", msg); log_atcommand(sd, logmsg); } } @@ -11443,7 +11443,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) if(log_config.gm && lv >= log_config.gm) { char message[256]; - snprintf(message, sizeof message, "/kick %s (%d)", tsd->status.name, tsd->status.char_id); + sprintf(message, "/kick %s (%d)", tsd->status.name, tsd->status.char_id); log_atcommand(sd, message); } @@ -11461,7 +11461,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) if(log_config.gm && lv >= log_config.gm) { char message[256]; - snprintf(message, sizeof message, "/kick %s (%d)", status_get_name(target), status_get_class(target)); + sprintf(message, "/kick %s (%d)", status_get_name(target), status_get_class(target)); log_atcommand(sd, message); } @@ -11480,7 +11480,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) if( log_config.gm && lv >= log_config.gm ) { char message[256]; - snprintf(message, sizeof message, "/kick %s (%d)", status_get_name(target), status_get_class(target)); + sprintf(message, "/kick %s (%d)", status_get_name(target), status_get_class(target)); log_atcommand(sd, message); } @@ -11521,7 +11521,7 @@ void clif_parse_GMShift(int fd, struct map_session_data *sd) atcommand_jumpto(fd, sd, "@jumpto", player_name); // as @jumpto if( log_config.gm && lv >= log_config.gm ) { char message[NAME_LENGTH+7]; - snprintf(message, sizeof message, "/shift %s", player_name); + sprintf(message, "/shift %s", player_name); log_atcommand(sd, message); } } @@ -11545,7 +11545,7 @@ void clif_parse_GMRecall(int fd, struct map_session_data *sd) atcommand_recall(fd, sd, "@recall", player_name); // as @recall if( log_config.gm && lv >= log_config.gm ) { char message[NAME_LENGTH+8]; - snprintf(message, sizeof message, "/recall %s", player_name); + sprintf(message, "/recall %s", player_name); log_atcommand(sd, message); } } @@ -11584,7 +11584,7 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) atcommand_item(fd, sd, "@item", monster_item_name); // as @item if( log_config.gm && level >= log_config.gm ) { //Log action. [Skotlex] - snprintf(message, sizeof message, "@item %s", monster_item_name); + sprintf(message, "@item %s", monster_item_name); log_atcommand(sd, message); } } @@ -11760,7 +11760,7 @@ void clif_parse_PMIgnore(int fd, struct map_session_data* sd) // Bot-check... if (strcmp(wisp_server_name, nick) == 0) { // to find possible bot users who automaticaly ignore people - snprintf(output, sizeof output, "Character '%s' (account: %d) has tried to block wisps from '%s' (wisp name of the server). Bot user?", sd->status.name, sd->status.account_id, wisp_server_name); + sprintf(output, "Character '%s' (account: %d) has tried to block wisps from '%s' (wisp name of the server). Bot user?", sd->status.name, sd->status.account_id, wisp_server_name); intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, output); WFIFOB(fd,3) = 1; // fail WFIFOSET(fd, packet_len(0x0d1)); @@ -12566,7 +12566,7 @@ void clif_Mail_refreshinbox(struct map_session_data *sd) if( md->full ) { char output[100]; - snprintf(output, sizeof output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX); + sprintf(output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX); clif_disp_onlyself(sd, output, strlen(output)); } } @@ -14625,7 +14625,7 @@ static int packetdb_readdb(void) for( i = 0; i < ARRAYLENGTH(packet_len_table); ++i ) packet_len(i) = packet_len_table[i]; - snprintf(line, sizeof line, "%s/packet_db.txt", db_path); + sprintf(line, "%s/packet_db.txt", db_path); if( (fp=fopen(line,"r"))==NULL ){ ShowFatalError("can't read %s\n", line); exit(EXIT_FAILURE); diff --git a/src/map/guild.c b/src/map/guild.c index abdc688e9..f90fc8946 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -110,7 +110,7 @@ int guild_read_guildskill_tree_db(void) char line[1024],*p; memset(guild_skill_tree,0,sizeof(guild_skill_tree)); - snprintf(line, sizeof line, "%s/guild_skill_tree.txt", db_path); + sprintf(line, "%s/guild_skill_tree.txt", db_path); if( (fp=fopen(line,"r"))==NULL){ ShowError("can't read %s\n", line); return -1; @@ -176,7 +176,7 @@ static int guild_read_castledb(void) char *str[32],*p; struct guild_castle *gc; - snprintf(line, sizeof line, "%s/castle_db.txt", db_path); + sprintf(line, "%s/castle_db.txt", db_path); if( (fp=fopen(line,"r"))==NULL){ ShowError("can't read %s\n", line); return -1; diff --git a/src/map/homunculus.c b/src/map/homunculus.c index c69d397b8..0fbd7cbff 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -259,7 +259,7 @@ int merc_hom_levelup(struct homun_data *hd) hom->luk += growth_luk; if ( battle_config.homunculus_show_growth ) { - snprintf(output, sizeof output, + sprintf(output, "Growth: hp:%d sp:%d str(%.2f) agi(%.2f) vit(%.2f) int(%.2f) dex(%.2f) luk(%.2f) ", growth_max_hp, growth_max_sp, growth_str/10.0, growth_agi/10.0, growth_vit/10.0, @@ -889,7 +889,7 @@ int read_homunculusdb(void) memset(homunculus_db,0,sizeof(homunculus_db)); for(i = 0; i<2; i++) { - snprintf(line, sizeof line, "%s/%s", db_path, filename[i]); + sprintf(line, "%s/%s", db_path, filename[i]); fp = fopen(line,"r"); if(!fp){ if(i != 0) @@ -1040,7 +1040,7 @@ int read_homunculus_skilldb(void) char *split[15]; memset(hskill_tree,0,sizeof(hskill_tree)); - snprintf(line, sizeof line, "%s/homun_skill_tree.txt", db_path); + sprintf(line, "%s/homun_skill_tree.txt", db_path); fp=fopen(line,"r"); if(fp==NULL){ ShowError("can't read %s\n", line); @@ -1108,7 +1108,7 @@ void read_homunculus_expdb(void) memset(hexptbl,0,sizeof(hexptbl)); for(i=0; i<2; i++){ - snprintf(line, sizeof line, "%s/%s", db_path, filename[i]); + sprintf(line, "%s/%s", db_path, filename[i]); fp=fopen(line,"r"); if(fp == NULL){ if(i != 0) diff --git a/src/map/intif.c b/src/map/intif.c index 4ecabac1a..15d948c59 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -262,8 +262,8 @@ int intif_regtostr(char* str, struct global_reg *reg, int qty) int len =0, i; for (i = 0; i < qty; i++) { - len+= snprintf(str+len, sizeof (str+len), "%s", reg[i].str)+1; //We add 1 to consider the '\0' in place. - len+= snprintf(str+len, sizeof (str+len), "%s", reg[i].value)+1; + len+= sprintf(str+len, "%s", reg[i].str)+1; //We add 1 to consider the '\0' in place. + len+= sprintf(str+len, "%s", reg[i].value)+1; } return len; } @@ -1471,7 +1471,7 @@ int intif_parse_Mail_inboxreceived(int fd) else { char output[128]; - snprintf(output, sizeof output, msg_txt(510), sd->mail.inbox.unchecked, sd->mail.inbox.unread + sd->mail.inbox.unchecked); + sprintf(output, msg_txt(510), sd->mail.inbox.unchecked, sd->mail.inbox.unread + sd->mail.inbox.unchecked); clif_disp_onlyself(sd, output, strlen(output)); } return 0; diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 1f5e13918..ce10f4f39 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -478,7 +478,7 @@ static int itemdb_read_itemavail (void) char line[1024], *str[10], *p; struct item_data *id; - snprintf(line, sizeof line, "%s/item_avail.txt", db_path); + sprintf(line, "%s/item_avail.txt", db_path); if ((fp = fopen(line,"r")) == NULL) { ShowError("can't read %s\n", line); return -1; @@ -600,7 +600,7 @@ static int itemdb_read_noequip(void) char *str[32],*p; struct item_data *id; - snprintf(line, sizeof line, "%s/item_noequip.txt", db_path); + sprintf(line, "%s/item_noequip.txt", db_path); if( (fp=fopen(line,"r"))==NULL ){ ShowError("can't read %s\n", line); return -1; @@ -644,7 +644,7 @@ static int itemdb_read_itemtrade(void) char line[1024], *str[10], *p; struct item_data *id; - snprintf(line, sizeof line, "%s/item_trade.txt", db_path); + sprintf(line, "%s/item_trade.txt", db_path); if ((fp = fopen(line,"r")) == NULL) { ShowError("can't read %s\n", line); return -1; @@ -690,7 +690,7 @@ static int itemdb_read_itemdelay(void) char line[1024], *str[10], *p; struct item_data *id; - snprintf(line, sizeof line, "%s/item_delay.txt", db_path); + sprintf(line, "%s/item_delay.txt", db_path); if ((fp = fopen(line,"r")) == NULL) { ShowError("can't read %s\n", line); return -1; @@ -880,7 +880,7 @@ static int itemdb_readdb(void) char path[256]; FILE* fp; - snprintf(path, sizeof path, "%s/%s", db_path, filename[fi]); + sprintf(path, "%s/%s", db_path, filename[fi]); fp = fopen(path, "r"); if( fp == NULL ) { diff --git a/src/map/map.c b/src/map/map.c index 2bc5b9b97..be2c53526 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2825,7 +2825,7 @@ int map_waterheight(char* mapname) char *rsw, *found; //Look up for the rsw - snprintf(fn, sizeof fn, "data\\%s.rsw", mapname); + sprintf(fn, "data\\%s.rsw", mapname); found = grfio_find_file(fn); if (found) strcpy(fn, found); // replace with real name @@ -2852,7 +2852,7 @@ int map_readgat (struct map_data* m) int water_height; size_t xy, off, num_cells; - snprintf(filename, sizeof filename, "data\\%s.gat", m->name); + sprintf(filename, "data\\%s.gat", m->name); gat = (uint8 *) grfio_read(filename); if (gat == NULL) diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 189f0793b..79bec2da6 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -411,7 +411,7 @@ int read_mercenarydb(void) struct s_mercenary_db *db; struct status_data *status; - snprintf(line, sizeof line, "%s/%s", db_path, "mercenary_db.txt"); + sprintf(line, "%s/%s", db_path, "mercenary_db.txt"); memset(mercenary_db,0,sizeof(mercenary_db)); fp = fopen(line, "r"); @@ -505,7 +505,7 @@ int read_mercenary_skilldb(void) int i, j = 0, k = 0, class_; int skillid, skilllv; - snprintf(line, sizeof line, "%s/%s", db_path, "mercenary_skill_db.txt"); + sprintf(line, "%s/%s", db_path, "mercenary_skill_db.txt"); fp = fopen(line, "r"); if( !fp ) { diff --git a/src/map/mob.c b/src/map/mob.c index 879a2c704..3c5a611af 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -343,7 +343,7 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target) // Message to KS if( DIFF_TICK(sd->ks_floodprotect_tick, tick) <= 0 ) { - snprintf(output, sizeof output, "[KS Warning!! - Owner : %s]", pl_sd->status.name); + sprintf(output, "[KS Warning!! - Owner : %s]", pl_sd->status.name); clif_disp_onlyself(sd, output, strlen(output)); sd->ks_floodprotect_tick = tick + 2000; @@ -352,7 +352,7 @@ bool mob_ksprotected (struct block_list *src, struct block_list *target) // Message to Owner if( DIFF_TICK(pl_sd->ks_floodprotect_tick, tick) <= 0 ) { - snprintf(output, sizeof output, "[Watch out! %s is trying to KS you!]", sd->status.name); + sprintf(output, "[Watch out! %s is trying to KS you!]", sd->status.name); clif_disp_onlyself(pl_sd, output, strlen(output)); pl_sd->ks_floodprotect_tick = tick + 2000; @@ -2234,7 +2234,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) struct item_data *i_data; char message[128]; i_data = itemdb_search(ditem->item_data.nameid); - snprintf (message, sizeof message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, (float)drop_rate/100); + sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, (float)drop_rate/100); //MSG: "'%s' won %s's %s (chance: %0.02f%%)" intif_broadcast(message,strlen(message)+1,0); } @@ -2360,7 +2360,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) struct item_data *i_data; char message[128]; i_data = itemdb_exists(item.nameid); - snprintf (message, sizeof message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, temp/100.); + sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, temp/100.); //MSG: "'%s' won %s's %s (chance: %0.02f%%)" intif_broadcast(message,strlen(message)+1,0); } @@ -3354,9 +3354,9 @@ static int mob_makedummymobdb(int class_) } //Initialize dummy data. mob_dummy = (struct mob_db*)aCalloc(1, sizeof(struct mob_db)); //Initializing the dummy mob. - snprintf(mob_dummy->sprite,sizeof mob_dummy->sprite,"DUMMY"); - snprintf(mob_dummy->name,sizeof mob_dummy->name,"Dummy"); - snprintf(mob_dummy->jname,sizeof mob_dummy->jname,"Dummy"); + sprintf(mob_dummy->sprite,"DUMMY"); + sprintf(mob_dummy->name,"Dummy"); + sprintf(mob_dummy->jname,"Dummy"); mob_dummy->lv=1; mob_dummy->status.max_hp=1000; mob_dummy->status.max_sp=1; @@ -3650,7 +3650,7 @@ static void mob_readdb(void) if(fi > 0) { - snprintf(path, sizeof path, "%s/%s", db_path, filename[fi]); + sprintf(path, "%s/%s", db_path, filename[fi]); if(!exists(path)) { continue; @@ -3780,7 +3780,7 @@ static int mob_read_randommonster(void) for( i = 0; i < ARRAYLENGTH(mobfile) && i < MAX_RANDOMMONSTER; i++ ) { mob_db_data[0]->summonper[i] = 1002; // Default fallback value, in case the database does not provide one - snprintf(line, sizeof line, "%s/%s", db_path, mobfile[i]); + sprintf(line, "%s/%s", db_path, mobfile[i]); fp=fopen(line,"r"); if(fp==NULL){ ShowError("can't read %s\n",line); @@ -3894,7 +3894,7 @@ static void mob_readchatdb(void) char line[1024], path[256]; int i, tmp=0; FILE *fp; - snprintf(path, sizeof path, "%s/%s", db_path, arc); + sprintf(path, "%s/%s", db_path, arc); fp=fopen(path, "r"); if(fp == NULL) { @@ -4218,7 +4218,7 @@ static void mob_readskilldb(void) if(fi > 0) { - snprintf(path, sizeof path, "%s/%s", db_path, filename[fi]); + sprintf(path, "%s/%s", db_path, filename[fi]); if(!exists(path)) { continue; diff --git a/src/map/npc.c b/src/map/npc.c index 2764e5cb9..0b16aa6f9 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -368,19 +368,19 @@ int npc_event_do_clock(int tid, unsigned int tick, int id, intptr data) } if (t->tm_min != ev_tm_b.tm_min ) { - snprintf(buf,sizeof buf,"OnMinute%02d",t->tm_min); + sprintf(buf,"OnMinute%02d",t->tm_min); c+=npc_event_doall(buf); - snprintf(buf,sizeof buf,"OnClock%02d%02d",t->tm_hour,t->tm_min); + sprintf(buf,"OnClock%02d%02d",t->tm_hour,t->tm_min); c+=npc_event_doall(buf); - snprintf(buf,sizeof buf,"On%s%02d%02d",day,t->tm_hour,t->tm_min); + sprintf(buf,"On%s%02d%02d",day,t->tm_hour,t->tm_min); c+=npc_event_doall(buf); } if (t->tm_hour!= ev_tm_b.tm_hour) { - snprintf(buf,sizeof buf,"OnHour%02d",t->tm_hour); + sprintf(buf,"OnHour%02d",t->tm_hour); c+=npc_event_doall(buf); } if (t->tm_mday!= ev_tm_b.tm_mday) { - snprintf(buf,sizeof buf,"OnDay%02d%02d",t->tm_mon+1,t->tm_mday); + sprintf(buf,"OnDay%02d%02d",t->tm_mon+1,t->tm_mday); c+=npc_event_doall(buf); } diff --git a/src/map/pc.c b/src/map/pc.c index 4cb371955..75097343d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -939,7 +939,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim if (battle_config.display_version == 1){ char buf[256]; - snprintf(buf, sizeof buf, "eAthena SVN version: %s", get_svn_revision()); + sprintf(buf, "eAthena SVN version: %s", get_svn_revision()); clif_displaymessage(sd->fd, buf); } @@ -3255,7 +3255,7 @@ void pc_paycash(struct map_session_data *sd, int price, int points) pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints - cash); pc_setaccountreg(sd,"#KAFRAPOINTS",sd->kafraPoints - points); - snprintf(output, sizeof output, "Used %d kafra points and %d cash points. %d kafra and %d cash points remaining.", points, cash, sd->kafraPoints, sd->cashPoints); + sprintf(output, "Used %d kafra points and %d cash points. %d kafra and %d cash points remaining.", points, cash, sd->kafraPoints, sd->cashPoints); clif_disp_onlyself(sd, output, strlen(output)); } @@ -3268,7 +3268,7 @@ void pc_getcash(struct map_session_data *sd, int cash, int points) { pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints + cash); - snprintf(output, sizeof output, "Gained %d cash points. Total %d points", cash, sd->cashPoints); + sprintf(output, "Gained %d cash points. Total %d points", cash, sd->cashPoints); clif_disp_onlyself(sd, output, strlen(output)); } @@ -3276,7 +3276,7 @@ void pc_getcash(struct map_session_data *sd, int cash, int points) { pc_setaccountreg(sd,"#KAFRAPOINTS",sd->kafraPoints + points); - snprintf(output, sizeof output, "Gained %d kafra points. Total %d points", points, sd->kafraPoints); + sprintf(output, "Gained %d kafra points. Total %d points", points, sd->kafraPoints); clif_disp_onlyself(sd, output, strlen(output)); } } @@ -3300,7 +3300,7 @@ int pc_getzeny(struct map_session_data *sd,int zeny) if( zeny > 0 && sd->state.showzeny ) { char output[255]; - snprintf(output, sizeof output, "Gained %dz.", zeny); + sprintf(output, "Gained %dz.", zeny); clif_disp_onlyself(sd,output,strlen(output)); } @@ -3922,9 +3922,9 @@ int pc_show_steal(struct block_list *bl,va_list ap) itemid=va_arg(ap,int); if((item=itemdb_exists(itemid))==NULL) - snprintf(output,sizeof output,"%s stole an Unknown Item (id: %i).",sd->status.name, itemid); + sprintf(output,"%s stole an Unknown Item (id: %i).",sd->status.name, itemid); else - snprintf(output,sizeof output,"%s stole %s.",sd->status.name,item->jname); + sprintf(output,"%s stole %s.",sd->status.name,item->jname); clif_displaymessage( ((struct map_session_data *)bl)->fd, output); return 0; @@ -4006,7 +4006,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv) struct item_data *i_data; char message[128]; i_data = itemdb_search(itemid); - snprintf(message, sizeof message, msg_txt(542), (sd->status.name != NULL)?sd->status.name :"GM", md->db->jname, i_data->jname, (float)md->db->dropitem[i].p/100); + sprintf (message, msg_txt(542), (sd->status.name != NULL)?sd->status.name :"GM", md->db->jname, i_data->jname, (float)md->db->dropitem[i].p/100); //MSG: "'%s' stole %s's %s (chance: %0.02f%%)" intif_broadcast(message,strlen(message)+1,0); } @@ -4938,7 +4938,7 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int #endif if(sd->state.showexp) { char output[256]; - snprintf(output, sizeof output, + sprintf(output, "Experience Gained Base:%u (%.2f%%) Job:%u (%.2f%%)",base_exp,nextbp*(float)100,job_exp,nextjp*(float)100); clif_disp_onlyself(sd,output,strlen(output)); } @@ -7730,7 +7730,7 @@ static int duel_showinfo_sub(struct map_session_data* sd, va_list va) if (sd->duel_group != ssd->duel_group) return 0; - snprintf(output, sizeof output, " %d. %s", ++(*p), sd->status.name); + sprintf(output, " %d. %s", ++(*p), sd->status.name); clif_disp_onlyself(ssd, output, strlen(output)); return 1; } @@ -7741,13 +7741,13 @@ int duel_showinfo(const unsigned int did, struct map_session_data* sd) char output[256]; if(duel_list[did].max_players_limit > 0) - snprintf(output, sizeof output, msg_txt(370), //" -- Duels: %d/%d, Members: %d/%d, Max players: %d --" + sprintf(output, msg_txt(370), //" -- Duels: %d/%d, Members: %d/%d, Max players: %d --" did, duel_count, duel_list[did].members_count, duel_list[did].members_count + duel_list[did].invites_count, duel_list[did].max_players_limit); else - snprintf(output, sizeof output, msg_txt(371), //" -- Duels: %d/%d, Members: %d/%d --" + sprintf(output, msg_txt(371), //" -- Duels: %d/%d, Members: %d/%d --" did, duel_count, duel_list[did].members_count, duel_list[did].members_count + duel_list[did].invites_count); @@ -7784,14 +7784,14 @@ int duel_invite(const unsigned int did, struct map_session_data* sd, struct map_ char output[256]; // " -- Player %s invites %s to duel --" - snprintf(output, sizeof output, msg_txt(373), sd->status.name, target_sd->status.name); + sprintf(output, msg_txt(373), sd->status.name, target_sd->status.name); clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); target_sd->duel_invite = did; duel_list[did].invites_count++; // "Blue -- Player %s invites you to PVP duel (@accept/@reject) --" - snprintf(output, sizeof output, msg_txt(374), sd->status.name); + sprintf(output, msg_txt(374), sd->status.name); clif_broadcast((struct block_list *)target_sd, output, strlen(output)+1, 0x10, SELF); return 0; } @@ -7809,7 +7809,7 @@ int duel_leave(const unsigned int did, struct map_session_data* sd) char output[256]; // " <- Player %s has left duel --" - snprintf(output, sizeof output, msg_txt(375), sd->status.name); + sprintf(output, msg_txt(375), sd->status.name); clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); duel_list[did].members_count--; @@ -7835,7 +7835,7 @@ int duel_accept(const unsigned int did, struct map_session_data* sd) sd->duel_invite = 0; // " -> Player %s has accepted duel --" - snprintf(output, sizeof output, msg_txt(376), sd->status.name); + sprintf(output, msg_txt(376), sd->status.name); clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); clif_set0199(sd, 1); @@ -7848,7 +7848,7 @@ int duel_reject(const unsigned int did, struct map_session_data* sd) char output[256]; // " -- Player %s has rejected duel --" - snprintf(output, sizeof output, msg_txt(377), sd->status.name); + sprintf(output, msg_txt(377), sd->status.name); clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); duel_list[did].invites_count--; @@ -7977,7 +7977,7 @@ int pc_readdb(void) // 必要??値?み?み memset(exp_table,0,sizeof(exp_table)); memset(max_level,0,sizeof(max_level)); - snprintf(line, sizeof line, "%s/exp.txt", db_path); + sprintf(line, "%s/exp.txt", db_path); fp=fopen(line, "r"); if(fp==NULL){ ShowError("can't read %s\n", line); @@ -8067,7 +8067,7 @@ int pc_readdb(void) for(k=0;k<ELE_MAX;k++) attr_fix_table[i][j][k]=100; - snprintf(line, sizeof line, "%s/attr_fix.txt", db_path); + sprintf(line, "%s/attr_fix.txt", db_path); fp=fopen(line,"r"); if(fp==NULL){ ShowError("can't read %s\n", line); @@ -8115,7 +8115,7 @@ int pc_readdb(void) // スキルツリ? memset(statp,0,sizeof(statp)); i=1; - snprintf(line, sizeof line, "%s/statpoint.txt", db_path); + sprintf(line, "%s/statpoint.txt", db_path); fp=fopen(line,"r"); if(fp == NULL){ ShowStatus("Can't read '"CL_WHITE"%s"CL_RESET"'... Generating DB.\n",line); diff --git a/src/map/pet.c b/src/map/pet.c index b0bb0bc6a..843f1cc11 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -1222,7 +1222,7 @@ int read_petdb() char line[1024]; int lines; - snprintf(line, sizeof line, "%s/%s", db_path, filename[i]); + sprintf(line, "%s/%s", db_path, filename[i]); fp=fopen(line,"r"); if( fp == NULL ) { diff --git a/src/map/quest.c b/src/map/quest.c index 99bf763cf..3e43fcda6 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -306,7 +306,7 @@ int quest_read_db(void) int i,j,k = 0; char *str[20],*p,*np; - snprintf(line, sizeof line, "%s/quest_db.txt", db_path); + sprintf(line, "%s/quest_db.txt", db_path); if( (fp=fopen(line,"r"))==NULL ){ ShowError("can't read %s\n", line); return -1; diff --git a/src/map/script.c b/src/map/script.c index 94eb9ccd7..ed07ac07c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -1166,32 +1166,32 @@ const char* parse_curly_close(const char* p) char label[256]; int l; // 一時変数を消す - snprintf(label,sizeof label,"set $@__SW%x_VAL,0;",syntax.curly[pos].index); + sprintf(label,"set $@__SW%x_VAL,0;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // 無条件で終了ポインタに移動 - snprintf(label,sizeof label,"goto __SW%x_FIN;",syntax.curly[pos].index); + sprintf(label,"goto __SW%x_FIN;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // 現在地のラベルを付ける - snprintf(label,sizeof label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); + sprintf(label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); l=add_str(label); set_label(l,script_pos, p); if(syntax.curly[pos].flag) { // default が存在する - snprintf(label,sizeof label,"goto __SW%x_DEF;",syntax.curly[pos].index); + sprintf(label,"goto __SW%x_DEF;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; } // 終了ラベルを付ける - snprintf(label,sizeof label,"__SW%x_FIN",syntax.curly[pos].index); + sprintf(label,"__SW%x_FIN",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos, p); linkdb_final(&syntax.curly[pos].case_label); // free the list of case label @@ -1219,16 +1219,16 @@ const char* parse_syntax(const char* p) int pos = syntax.curly_count - 1; while(pos >= 0) { if(syntax.curly[pos].type == TYPE_DO) { - snprintf(label,sizeof label,"goto __DO%x_FIN;",syntax.curly[pos].index); + sprintf(label,"goto __DO%x_FIN;",syntax.curly[pos].index); break; } else if(syntax.curly[pos].type == TYPE_FOR) { - snprintf(label,sizeof label,"goto __FR%x_FIN;",syntax.curly[pos].index); + sprintf(label,"goto __FR%x_FIN;",syntax.curly[pos].index); break; } else if(syntax.curly[pos].type == TYPE_WHILE) { - snprintf(label,sizeof label,"goto __WL%x_FIN;",syntax.curly[pos].index); + sprintf(label,"goto __WL%x_FIN;",syntax.curly[pos].index); break; } else if(syntax.curly[pos].type == TYPE_SWITCH) { - snprintf(label,sizeof label,"goto __SW%x_FIN;",syntax.curly[pos].index); + sprintf(label,"goto __SW%x_FIN;",syntax.curly[pos].index); break; } pos--; @@ -1262,13 +1262,13 @@ const char* parse_syntax(const char* p) char *np; if(syntax.curly[pos].count != 1) { // FALLTHRU 用のジャンプ - snprintf(label,sizeof label,"goto __SW%x_%xJ;",syntax.curly[pos].index,syntax.curly[pos].count); + sprintf(label,"goto __SW%x_%xJ;",syntax.curly[pos].index,syntax.curly[pos].count); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // 現在地のラベルを付ける - snprintf(label,sizeof label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); + sprintf(label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); l=add_str(label); set_label(l,script_pos, p); } @@ -1299,7 +1299,7 @@ const char* parse_syntax(const char* p) p = skip_space(p); if(*p != ':') disp_error_message("parse_syntax: expect ':'",p); - snprintf(label,sizeof label,"if(%d != $@__SW%x_VAL) goto __SW%x_%x;", + sprintf(label,"if(%d != $@__SW%x_VAL) goto __SW%x_%x;", v,syntax.curly[pos].index,syntax.curly[pos].index,syntax.curly[pos].count+1); syntax.curly[syntax.curly_count++].type = TYPE_NULL; // 2回parse しないとダメ @@ -1308,7 +1308,7 @@ const char* parse_syntax(const char* p) syntax.curly_count--; if(syntax.curly[pos].count != 1) { // FALLTHRU 終了後のラベル - snprintf(label,sizeof label,"__SW%x_%xJ",syntax.curly[pos].index,syntax.curly[pos].count); + sprintf(label,"__SW%x_%xJ",syntax.curly[pos].index,syntax.curly[pos].count); l=add_str(label); set_label(l,script_pos,p); } @@ -1317,7 +1317,7 @@ const char* parse_syntax(const char* p) disp_error_message("parse_syntax: dup 'case'",p); linkdb_insert(&syntax.curly[pos].case_label, (void*)v, (void*)1); - snprintf(label,sizeof label,"set $@__SW%x_VAL,0;",syntax.curly[pos].index); + sprintf(label,"set $@__SW%x_VAL,0;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); @@ -1331,14 +1331,14 @@ const char* parse_syntax(const char* p) int pos = syntax.curly_count - 1; while(pos >= 0) { if(syntax.curly[pos].type == TYPE_DO) { - snprintf(label,sizeof label,"goto __DO%x_NXT;",syntax.curly[pos].index); + sprintf(label,"goto __DO%x_NXT;",syntax.curly[pos].index); syntax.curly[pos].flag = 1; // continue 用のリンク張るフラグ break; } else if(syntax.curly[pos].type == TYPE_FOR) { - snprintf(label,sizeof label,"goto __FR%x_NXT;",syntax.curly[pos].index); + sprintf(label,"goto __FR%x_NXT;",syntax.curly[pos].index); break; } else if(syntax.curly[pos].type == TYPE_WHILE) { - snprintf(label,sizeof label,"goto __WL%x_NXT;",syntax.curly[pos].index); + sprintf(label,"goto __WL%x_NXT;",syntax.curly[pos].index); break; } pos--; @@ -1375,18 +1375,18 @@ const char* parse_syntax(const char* p) if(*p != ':') { disp_error_message("parse_syntax: need ':'",p); } - snprintf(label,sizeof label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); + sprintf(label,"__SW%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); l=add_str(label); set_label(l,script_pos,p); // 無条件で次のリンクに飛ばす - snprintf(label,sizeof label,"goto __SW%x_%x;",syntax.curly[pos].index,syntax.curly[pos].count+1); + sprintf(label,"goto __SW%x_%x;",syntax.curly[pos].index,syntax.curly[pos].count+1); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // default のラベルを付ける - snprintf(label,sizeof label,"__SW%x_DEF",syntax.curly[pos].index); + sprintf(label,"__SW%x_DEF",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); @@ -1404,7 +1404,7 @@ const char* parse_syntax(const char* p) syntax.curly[syntax.curly_count].index = syntax.index++; syntax.curly[syntax.curly_count].flag = 0; // 現在地のラベル形成する - snprintf(label,sizeof label,"__DO%x_BGN",syntax.curly[syntax.curly_count].index); + sprintf(label,"__DO%x_BGN",syntax.curly[syntax.curly_count].index); l=add_str(label); set_label(l,script_pos,p); syntax.curly_count++; @@ -1435,7 +1435,7 @@ const char* parse_syntax(const char* p) syntax.curly_count--; // 条件判断開始のラベル形成する - snprintf(label,sizeof label,"__FR%x_J",syntax.curly[pos].index); + sprintf(label,"__FR%x_J",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); @@ -1445,7 +1445,7 @@ const char* parse_syntax(const char* p) ; } else { // 条件が偽なら終了地点に飛ばす - snprintf(label,sizeof label,"__FR%x_FIN",syntax.curly[pos].index); + sprintf(label,"__FR%x_FIN",syntax.curly[pos].index); add_scriptl(add_str("jump_zero")); add_scriptc(C_ARG); p=parse_expr(p); @@ -1458,13 +1458,13 @@ const char* parse_syntax(const char* p) p++; // ループ開始に飛ばす - snprintf(label,sizeof label,"goto __FR%x_BGN;",syntax.curly[pos].index); + sprintf(label,"goto __FR%x_BGN;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // 次のループへのラベル形成する - snprintf(label,sizeof label,"__FR%x_NXT",syntax.curly[pos].index); + sprintf(label,"__FR%x_NXT",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); @@ -1477,13 +1477,13 @@ const char* parse_syntax(const char* p) parse_syntax_for_flag = 0; // 条件判定処理に飛ばす - snprintf(label,sizeof label,"goto __FR%x_J;",syntax.curly[pos].index); + sprintf(label,"goto __FR%x_J;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // ループ開始のラベル付け - snprintf(label,sizeof label,"__FR%x_BGN",syntax.curly[pos].index); + sprintf(label,"__FR%x_BGN",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); return p; @@ -1520,7 +1520,7 @@ const char* parse_syntax(const char* p) ++syntax.curly_count; // Jump over the function code - snprintf(label,sizeof label, "goto __FN%x_FIN;", syntax.curly[syntax.curly_count-1].index); + sprintf(label, "goto __FN%x_FIN;", syntax.curly[syntax.curly_count-1].index); syntax.curly[syntax.curly_count].type = TYPE_NULL; ++syntax.curly_count; parse_line(label); @@ -1554,7 +1554,7 @@ const char* parse_syntax(const char* p) syntax.curly[syntax.curly_count].count = 1; syntax.curly[syntax.curly_count].index = syntax.index++; syntax.curly[syntax.curly_count].flag = 0; - snprintf(label,sizeof label,"__IF%x_%x",syntax.curly[syntax.curly_count].index,syntax.curly[syntax.curly_count].count); + sprintf(label,"__IF%x_%x",syntax.curly[syntax.curly_count].index,syntax.curly[syntax.curly_count].count); syntax.curly_count++; add_scriptl(add_str("jump_zero")); add_scriptc(C_ARG); @@ -1578,7 +1578,7 @@ const char* parse_syntax(const char* p) syntax.curly[syntax.curly_count].count = 1; syntax.curly[syntax.curly_count].index = syntax.index++; syntax.curly[syntax.curly_count].flag = 0; - snprintf(label,sizeof label,"$@__SW%x_VAL",syntax.curly[syntax.curly_count].index); + sprintf(label,"$@__SW%x_VAL",syntax.curly[syntax.curly_count].index); syntax.curly_count++; add_scriptl(add_str("set")); add_scriptc(C_ARG); @@ -1606,12 +1606,12 @@ const char* parse_syntax(const char* p) syntax.curly[syntax.curly_count].index = syntax.index++; syntax.curly[syntax.curly_count].flag = 0; // 条件判断開始のラベル形成する - snprintf(label,sizeof label,"__WL%x_NXT",syntax.curly[syntax.curly_count].index); + sprintf(label,"__WL%x_NXT",syntax.curly[syntax.curly_count].index); l=add_str(label); set_label(l,script_pos,p); // 条件が偽なら終了地点に飛ばす - snprintf(label,sizeof label,"__WL%x_FIN",syntax.curly[syntax.curly_count].index); + sprintf(label,"__WL%x_FIN",syntax.curly[syntax.curly_count].index); syntax.curly_count++; add_scriptl(add_str("jump_zero")); add_scriptc(C_ARG); @@ -1653,13 +1653,13 @@ const char* parse_syntax_close_sub(const char* p,int* flag) const char *bp = p; const char *p2; // if 最終場所へ飛ばす - snprintf(label,sizeof label,"goto __IF%x_FIN;",syntax.curly[pos].index); + sprintf(label,"goto __IF%x_FIN;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // 現在地のラベルを付ける - snprintf(label,sizeof label,"__IF%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); + sprintf(label,"__IF%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); l=add_str(label); set_label(l,script_pos,p); @@ -1676,7 +1676,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag) if(*p != '(') { disp_error_message("need '('",p); } - snprintf(label,sizeof label,"__IF%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); + sprintf(label,"__IF%x_%x",syntax.curly[pos].index,syntax.curly[pos].count); add_scriptl(add_str("jump_zero")); add_scriptc(C_ARG); p=parse_expr(p); @@ -1697,7 +1697,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag) // if 閉じ syntax.curly_count--; // 最終地のラベルを付ける - snprintf(label,sizeof label,"__IF%x_FIN",syntax.curly[pos].index); + sprintf(label,"__IF%x_FIN",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); if(syntax.curly[pos].flag == 1) { @@ -1712,7 +1712,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag) if(syntax.curly[pos].flag) { // 現在地のラベル形成する(continue でここに来る) - snprintf(label,sizeof label,"__DO%x_NXT",syntax.curly[pos].index); + sprintf(label,"__DO%x_NXT",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); } @@ -1727,7 +1727,7 @@ const char* parse_syntax_close_sub(const char* p,int* flag) if(*p != '(') { disp_error_message("need '('",p); } - snprintf(label,sizeof label,"__DO%x_FIN",syntax.curly[pos].index); + sprintf(label,"__DO%x_FIN",syntax.curly[pos].index); add_scriptl(add_str("jump_zero")); add_scriptc(C_ARG); p=parse_expr(p); @@ -1736,13 +1736,13 @@ const char* parse_syntax_close_sub(const char* p,int* flag) add_scriptc(C_FUNC); // 開始地点に飛ばす - snprintf(label,sizeof label,"goto __DO%x_BGN;",syntax.curly[pos].index); + sprintf(label,"goto __DO%x_BGN;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // 条件終了地点のラベル形成する - snprintf(label,sizeof label,"__DO%x_FIN",syntax.curly[pos].index); + sprintf(label,"__DO%x_FIN",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); p = skip_space(p); @@ -1755,26 +1755,26 @@ const char* parse_syntax_close_sub(const char* p,int* flag) return p; } else if(syntax.curly[pos].type == TYPE_FOR) { // 次のループに飛ばす - snprintf(label,sizeof label,"goto __FR%x_NXT;",syntax.curly[pos].index); + sprintf(label,"goto __FR%x_NXT;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // for 終了のラベル付け - snprintf(label,sizeof label,"__FR%x_FIN",syntax.curly[pos].index); + sprintf(label,"__FR%x_FIN",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); syntax.curly_count--; return p; } else if(syntax.curly[pos].type == TYPE_WHILE) { // while 条件判断へ飛ばす - snprintf(label,sizeof label,"goto __WL%x_NXT;",syntax.curly[pos].index); + sprintf(label,"goto __WL%x_NXT;",syntax.curly[pos].index); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // while 終了のラベル付け - snprintf(label,sizeof label,"__WL%x_FIN",syntax.curly[pos].index); + sprintf(label,"__WL%x_FIN",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); syntax.curly_count--; @@ -1784,13 +1784,13 @@ const char* parse_syntax_close_sub(const char* p,int* flag) char label[256]; int l; // 戻す - snprintf(label,sizeof label,"return;"); + sprintf(label,"return;"); syntax.curly[syntax.curly_count++].type = TYPE_NULL; parse_line(label); syntax.curly_count--; // 現在地のラベルを付ける - snprintf(label,sizeof label,"__FN%x_FIN",syntax.curly[pos].index); + sprintf(label,"__FN%x_FIN",syntax.curly[pos].index); l=add_str(label); set_label(l,script_pos,p); syntax.curly_count--; @@ -1844,7 +1844,7 @@ static void read_constdb(void) char line[1024],name[1024],val[1024]; int n,type; - snprintf(line, sizeof line, "%s/const.txt", db_path); + sprintf(line, "%s/const.txt", db_path); fp=fopen(line, "r"); if(fp==NULL){ ShowError("can't read %s\n", line); @@ -10603,7 +10603,7 @@ BUILDIN_FUNC(getinventorylist) pc_setreg(sd,add_str("@inventorylist_attribute")+(j<<24),sd->status.inventory[i].attribute); for (k = 0; k < MAX_SLOTS; k++) { - snprintf(card_var, sizeof card_var, "@inventorylist_card%d",k+1); + sprintf(card_var, "@inventorylist_card%d",k+1); pc_setreg(sd,add_str(card_var)+(j<<24),sd->status.inventory[i].card[k]); } pc_setreg(sd,add_str("@inventorylist_expire")+(j<<24),sd->status.inventory[i].expire_time); diff --git a/src/map/trade.c b/src/map/trade.c index 8dd6600a6..32c84b508 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -194,9 +194,9 @@ int impossible_trade_check(struct map_session_data *sd) index = sd->deal.item[i].index; if (inventory[index].amount < sd->deal.item[i].amount) { // if more than the player have -> hack - snprintf(message_to_gm, sizeof message_to_gm, msg_txt(538), sd->status.name, sd->status.account_id); // Hack on trade: character '%s' (account: %d) try to trade more items that he has. + sprintf(message_to_gm, msg_txt(538), sd->status.name, sd->status.account_id); // Hack on trade: character '%s' (account: %d) try to trade more items that he has. intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, message_to_gm); - snprintf(message_to_gm, sizeof message_to_gm, msg_txt(539), inventory[index].amount, inventory[index].nameid, sd->deal.item[i].amount); // This player has %d of a kind of item (id: %d), and try to trade %d of them. + sprintf(message_to_gm, msg_txt(539), inventory[index].amount, inventory[index].nameid, sd->deal.item[i].amount); // This player has %d of a kind of item (id: %d), and try to trade %d of them. intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, message_to_gm); // if we block people if (battle_config.ban_hack_trade < 0) { @@ -209,7 +209,7 @@ int impossible_trade_check(struct map_session_data *sd) chrif_char_ask_name(-1, sd->status.name, 2, 0, 0, 0, 0, battle_config.ban_hack_trade, 0); // type: 2 - ban (year, month, day, hour, minute, second) set_eof(sd->fd); // forced to disconnect because of the hack // message about the ban - snprintf(message_to_gm, sizeof message_to_gm, msg_txt(507), battle_config.ban_hack_trade); // This player has been banned for %d minute(s). + sprintf(message_to_gm, msg_txt(507), battle_config.ban_hack_trade); // This player has been banned for %d minute(s). } else // message about the ban strcpy(message_to_gm, msg_txt(508)); // This player hasn't been banned (Ban option is disabled). diff --git a/src/map/vending.c b/src/map/vending.c index 687b2ca95..67e5ebf19 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -180,7 +180,7 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int cid, const ui if( battle_config.buyer_name ) { char temp[256]; - snprintf(temp, sizeof temp, msg_txt(265), sd->status.name); + sprintf(temp, msg_txt(265), sd->status.name); clif_disp_onlyself(vsd,temp,strlen(temp)); } } diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c index 62fa78650..ef9c08534 100644 --- a/src/plugins/dbghelpplug.c +++ b/src/plugins/dbghelpplug.c @@ -1753,13 +1753,13 @@ Dhp__CreateFiles( #endif timestamp[LEN_TIMESTAMP] = '\0'; - snprintf(out_logFileName, sizeof out_logFileName, "%s%s.rpt", baseFileName, timestamp); + sprintf(out_logFileName, "%s%s.rpt", baseFileName, timestamp); fp = fopen(out_logFileName, "w"); if( fp == NULL ) return FALSE; // failed to create log file fclose(fp); - snprintf(out_dmpFileName, sizeof out_dmpFileName, "%s%s.dmp", baseFileName, timestamp); + sprintf(out_dmpFileName, "%s%s.dmp", baseFileName, timestamp); fp = fopen(out_dmpFileName, "w"); if( fp == NULL) return FALSE; // failed to create dump file diff --git a/src/plugins/sig.c b/src/plugins/sig.c index 0621bd2b9..1872d48ff 100644 --- a/src/plugins/sig.c +++ b/src/plugins/sig.c @@ -104,7 +104,7 @@ void sig_dump(int sn) crash_flag = 1; // search for a usable filename do { - snprintf(file, sizeof file, "log/%s%04d.stackdump", server_name, ++no); + sprintf (file, "log/%s%04d.stackdump", server_name, ++no); } while((fp = fopen(file,"r")) && (fclose(fp), no < 9999)); // dump the trace into the file diff --git a/src/tool/grfio.c b/src/tool/grfio.c index 03938ee24..26cfb636f 100644 --- a/src/tool/grfio.c +++ b/src/tool/grfio.c @@ -402,7 +402,7 @@ int grfio_size(char* fname) FILELIST lentry; struct stat st; - snprintf(lfname, sizeof lfname, "%s%s", data_dir, fname); + sprintf(lfname, "%s%s", data_dir, fname); for (p = &lfname[0]; *p != 0; p++) if (*p=='\\') *p = '/'; @@ -435,7 +435,7 @@ void* grfio_reads(char* fname, int* size) char lfname[256], *p; FILELIST lentry; - snprintf(lfname, sizeof lfname, "%s%s", data_dir, fname); + sprintf(lfname, "%s%s", data_dir, fname); for (p = &lfname[0]; *p != 0; p++) if (*p == '\\') *p = '/'; @@ -697,7 +697,7 @@ static void grfio_resourcecheck(void) FILE* fp; // read resnametable from data directory and return if successful - snprintf(restable, sizeof restable, "%sdata\\resnametable.txt", data_dir); + sprintf(restable, "%sdata\\resnametable.txt", data_dir); for (ptr = &restable[0]; *ptr != 0; ptr++) if (*ptr == '\\') *ptr = '/'; @@ -709,8 +709,8 @@ static void grfio_resourcecheck(void) // we only need the maps' GAT and RSW files (strstr(w2, ".gat") || strstr(w2, ".rsw"))) { - snprintf(src, sizeof src, "data\\%s", w1); - snprintf(dst, sizeof dst, "data\\%s", w2); + sprintf(src, "data\\%s", w1); + sprintf(dst, "data\\%s", w2); entry = filelist_find(dst); // create new entries reusing the original's info if (entry != NULL) { @@ -736,8 +736,8 @@ static void grfio_resourcecheck(void) if (sscanf(ptr, "%[^#]#%[^#]#", w1, w2) == 2 && (strstr(w2, ".gat") || strstr(w2, ".rsw"))) { - snprintf(src, sizeof src, "data\\%s", w1); - snprintf(dst, sizeof dst, "data\\%s", w2); + sprintf(src, "data\\%s", w1); + sprintf(dst, "data\\%s", w2); entry = filelist_find(dst); if (entry != NULL) { FILELIST fentry; diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c index c103ae4f5..49e1826ab 100644 --- a/src/tool/mapcache.c +++ b/src/tool/mapcache.c @@ -112,13 +112,13 @@ int read_map(char *name, struct map_data *m) uint32 type; // Open map GAT - snprintf(filename,sizeof filename,"data\\%s.gat", name); + sprintf(filename,"data\\%s.gat", name); gat = (unsigned char *)grfio_read(filename); if (gat == NULL) return 0; // Open map RSW - snprintf(filename,sizeof filename,"data\\%s.rsw", name); + sprintf(filename,"data\\%s.rsw", name); rsw = (unsigned char *)grfio_read(filename); // Read water height |