[Feature][ZXW-285]merge P56U05 version

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: Ied657102425a179a89ef41847170152e8a5d437c
diff --git a/ap/app/fs_check/mtd.c b/ap/app/fs_check/mtd.c
index c2ef0e6..c610bf0 100755
--- a/ap/app/fs_check/mtd.c
+++ b/ap/app/fs_check/mtd.c
@@ -338,29 +338,38 @@
 

 	p_dst = read_file(p_dst_file, &dst_len);

 	p_src = read_file(p_src_file, &src_len);

-	if ((dst_len == 0) && (src_len == 0))

+	if (p_dst == NULL && p_src == NULL)

 	{

-		assert(p_dst == NULL);

-		assert(p_src == NULL);

+		assert(dst_len == 0);

+		assert(src_len == 0);

 		return 0; //both empty file

 	}

-

-	if(dst_len != src_len)

+	else if (p_dst == NULL || p_src == NULL)

 	{

 		printf("compare_file size dstbuf = %d, srcbuf = %d\n", dst_len, src_len);

 		sc_debug_info_record(MODULE_ID_AP_FS_CHECK, "compare_file size dstbuf = %d, srcbuf = %d\n", dst_len, src_len);

 		ret = -1;

 		goto out;

 	}

-

-	if(memcmp(p_src, p_dst, src_len) != 0)

+	else

 	{

-		printf("compare_file memcmp not same\n");

-		sc_debug_info_record(MODULE_ID_AP_FS_CHECK, "compare_file memcmp not same\n");

-		ret = -1;

-		goto out;

+		if(dst_len != src_len)

+		{

+			printf("compare_file size dstbuf = %d, srcbuf = %d\n", dst_len, src_len);

+			sc_debug_info_record(MODULE_ID_AP_FS_CHECK, "compare_file size dstbuf = %d, srcbuf = %d\n", dst_len, src_len);

+			ret = -1;

+			goto out;

+		}

+

+		if(memcmp(p_src, p_dst, src_len) != 0)

+		{

+			printf("compare_file memcmp not same\n");

+			sc_debug_info_record(MODULE_ID_AP_FS_CHECK, "compare_file memcmp not same\n");

+			ret = -1;

+			goto out;

+		}

+		ret = 0;

 	}

-	ret = 0;

 

 out:

 	if (p_src)