From 8821594608a78a192d09d84a5f2232c8c6ece9b1 Mon Sep 17 00:00:00 2001 From: liuwei Date: Tue, 18 Aug 2015 18:36:07 +0800 Subject: [PATCH] eliminate potential trouble --- src/ini_file_reader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ini_file_reader.c b/src/ini_file_reader.c index 23134af..937e29f 100644 --- a/src/ini_file_reader.c +++ b/src/ini_file_reader.c @@ -46,12 +46,12 @@ void iniSetAnnotationCallBack(AnnotationMap *map, int count) g_annotataionMap = (AnnotationMap *) malloc(bytes); if (g_annotataionMap == NULL) { logError("file: "__FILE__", line: %d, " \ - "malloc fail, errno: %d, error info: %s", \ - __LINE__, errno, STRERROR(errno)); + "malloc (%d) fail, errno: %d, error info: %s", \ + __LINE__, bytes, errno, STRERROR(errno)); return; } - memcpy(g_annotataionMap, map, bytes); + memcpy(g_annotataionMap, map, sizeof(AnnotationMap) * count); p = g_annotataionMap + count; p->func_name = NULL;