From aace438194ba1da0b99ed68ae2568a67c212782c Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 12 Jan 2012 01:09:30 +0000 Subject: Fixed bug with @commands/@charcommands not displaying aliases git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15433 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index cf12836e3..f27fa0026 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -55,9 +55,10 @@ char* msg_table[MAX_MSG]; // Server messages (0-499 reserved for GM commands, 50 DBMap* atcommand_db = NULL;//name -> AtCommandInfo -typedef struct AtCommandInfo -{ - const char* command; +#define ATCOMMAND_LENGTH 50 + +typedef struct AtCommandInfo { + char command[ATCOMMAND_LENGTH]; int level; int level2; AtCommandFunc func; @@ -9063,7 +9064,7 @@ void atcommand_basecommands(void) { CREATE(atcommand, AtCommandInfo, 1); - atcommand->command = atcommand_base[i].command; + safestrncpy(atcommand->command,atcommand_base[i].command,sizeof(atcommand->command)); atcommand->level = atcommand_base[i].level; atcommand->level2 = atcommand_base[i].level2; atcommand->func = atcommand_base[i].func; @@ -9268,7 +9269,7 @@ void atcommand_parse_aliases(char aliases[1024],AtCommandInfo* base) { CREATE(atcommand, AtCommandInfo, 1); - atcommand->command = str[i]; + safestrncpy(atcommand->command,str[i],sizeof(atcommand->command)); atcommand->level = base->level; atcommand->level2 = base->level2; atcommand->func = base->func; -- cgit v1.2.3-60-g2f50