tools: acrn-crashlog: remove unsafe apis from android_events.c

1. Refine strings operation.
2. Remove sscanf, sprintf and strlen.

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 10:08:24 +08:00
committed by Xie, Nanlin
parent 48ce01a52f
commit 5ecf1078ca
8 changed files with 269 additions and 311 deletions

View File

@@ -319,6 +319,20 @@ struct log_t *get_log_by_name(char *name)
return NULL;
}
struct vm_t *get_vm_by_name(const char *name)
{
int id;
struct vm_t *vm;
for_each_vm(id, vm, conf) {
if (!vm)
continue;
if (strcmp(name, vm->name) == 0)
return vm;
}
return NULL;
}
int crash_depth(struct crash_t *tcrash)
{
int id;