Change the size and nmemb of fread() to check the return value 13/199013/1
authorjiyong.min <jiyong.min@samsung.com>
Fri, 1 Feb 2019 00:39:25 +0000 (09:39 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Fri, 1 Feb 2019 00:39:25 +0000 (09:39 +0900)
Change-Id: Icff42f9f037df9b44cd5ab07420dab1037747463

tests/mm_file_test.c

index 65c9c6b..4f99f34 100755 (executable)
@@ -179,7 +179,7 @@ inline static int mm_file_is_little_endian(void)
                        size = ftell(fp);       \
                        if (fseek(fp, 0, SEEK_SET) < 0) { printf("fseek failed\n"); fclose(fp); break; }        \
                        if (size > 0) data = malloc(size);      \
-                       if (data != NULL) { if (fread(data, size, sizeof(char), fp) != size) { printf("fread error\n"); } }     \
+                       if (data != NULL) { if (fread(data, sizeof(char), size, fp) != size) { printf("fread error\n"); } }     \
                        fclose(fp);     \
                        printf("file size = %d\n", size);       \
                }       \