From 6a8fdfaae0bcfd230109019484e568edf15570eb Mon Sep 17 00:00:00 2001 From: Kpy! Date: Wed, 8 Apr 2015 17:19:36 +0200 Subject: Fix some issues with the @help command. Fix help messages being trimmed due to an incorrect length value. Fix help messages formatting: use clif_displaymessage2 to properly display newlines. Closes #491 as merged --- src/map/atcommand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 889deac49..b284323fd 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1531,7 +1531,7 @@ ACMD(help) { } // Display help contents - clif->message(fd, tinfo->help); + clif->messageln(fd, tinfo->help); return true; } @@ -10092,8 +10092,8 @@ void atcommand_config_read(const char* config_filename) { if( commandinfo->help == NULL ) { const char *str = libconfig->setting_get_string(command); size_t len = strlen(str); - commandinfo->help = aMalloc( len * sizeof(char) ); - safestrncpy(commandinfo->help, str, len); + commandinfo->help = aMalloc(len + 1); + safestrncpy(commandinfo->help, str, len + 1); } } } -- cgit v1.2.3-70-g09d2