tools: acrn-crashlog: refine the configuration structure

1. get string size when parsing configuration.
2. add 'const' for strings got from configuration.

Tracked-On: #1254
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This commit is contained in:
Liu, Xinwu
2018-09-25 16:21:47 +08:00
committed by Xie, Nanlin
parent fe4d503c3d
commit 6938caa25f
12 changed files with 153 additions and 90 deletions

View File

@@ -206,7 +206,7 @@ static int reserve_log_folder(enum e_dir_mode mode, char *dir,
int plen;
int dlen;
struct sender_t *crashlog;
char *outdir;
const char *outdir;
unsigned int maxdirs;
crashlog = get_sender_by_name("crashlog");
@@ -273,9 +273,9 @@ static int reserve_log_folder(enum e_dir_mode mode, char *dir,
* @param type Subtype of this event.
* @param data* String obtained by get_data.
*/
void generate_crashfile(char *dir, char *event, char *hashkey,
char *type, char *data0,
char *data1, char *data2)
void generate_crashfile(const char *dir, const char *event, const char *hashkey,
const char *type, const char *data0,
const char *data1, const char *data2)
{
char *buf;
char *path;