Skip to content

Commit 4d71a12

Browse files
Fixed a few EVENT_NAME_LENGTH usages
1 parent d307743 commit 4d71a12

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/map/npc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ int npc_event_doall(const char* name)
430430
int npc_event_doall_id(const char* name, int rid)
431431
{
432432
int c = 0;
433-
char buf[64];
433+
char buf[EVENT_NAME_LENGTH];
434434
safesnprintf(buf, sizeof(buf), "::%s", name);
435435
ev_db->foreach(ev_db,npc_event_doall_sub,&c,buf,rid);
436436
return c;
@@ -445,7 +445,7 @@ int npc_event_do_clock(int tid, unsigned int tick, int id, intptr_t data)
445445
static struct tm ev_tm_b; // tracks previous execution time
446446
time_t timer;
447447
struct tm* t;
448-
char buf[64];
448+
char buf[EVENT_NAME_LENGTH];
449449
int c = 0;
450450

451451
timer = time(NULL);
@@ -3550,7 +3550,7 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c
35503550
int l;
35513551
ARR_FIND( 0, MAX_EVENTQUEUE, l, sd->eventqueue[l][0] == '\0' );
35523552
if( l < MAX_EVENTQUEUE ) {
3553-
safestrncpy(sd->eventqueue[l],eventname,50); //Event enqueued.
3553+
safestrncpy(sd->eventqueue[l],eventname,EVENT_NAME_LENGTH); //Event enqueued.
35543554
return 0;
35553555
}
35563556

@@ -4380,9 +4380,9 @@ void npc_read_event_script(void)
43804380
DBIterator* iter;
43814381
DBKey key;
43824382
DBData *data;
4383+
char name[EVENT_NAME_LENGTH];
43834384

4384-
char name[64]="::";
4385-
safestrncpy(name+2,config[i].event_name,62);
4385+
safesnprintf(name,EVENT_NAME_LENGTH,"::%s",config[i].event_name);
43864386

43874387
script_event[i].event_count = 0;
43884388
iter = db_iterator(ev_db);

0 commit comments

Comments
 (0)