From: Zdenek S. <st...@us...> - 2013-07-24 05:42:26
|
Update of /cvsroot/ipmitool/ipmitool/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28745/lib Modified Files: ipmi_ekanalyzer.c Log Message: ID: 65 - Fixes for configure.in for cross compilation Changes to ipmi_ek_display_board_info_area() in order to get rid off warnings. Commit for Dan Gora Index: ipmi_ekanalyzer.c =================================================================== RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_ekanalyzer.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ipmi_ekanalyzer.c 24 Jul 2013 05:37:12 -0000 1.25 --- ipmi_ekanalyzer.c 24 Jul 2013 05:42:23 -0000 1.26 *************** *** 2712,2715 **** --- 2712,2716 ---- { size_t file_offset; + int ret = 0; unsigned char len = 0; unsigned int size_board = 0; *************** *** 2719,2732 **** } file_offset = ftell(input_file); ! /* Board length */ ! if (!feof(input_file)) { ! fread(&len, 1, 1, input_file); ! (*board_length)--; ! } ! /* Board Data */ ! if (feof(input_file)) { ! printf("No Board Data found!\n"); goto out; } /* Bit 5:0 of Board Mfg type represent legnth */ size_board = (len & 0x3f); --- 2720,2732 ---- } file_offset = ftell(input_file); ! ! /* Board length*/ ! ret = fread(&len, 1, 1, input_file); ! if ((ret != 1) || ferror(input_file)) { ! lprintf(LOG_ERR, "Invalid Length!"); goto out; } + (*board_length)--; + /* Bit 5:0 of Board Mfg type represent legnth */ size_board = (len & 0x3f); *************** *** 2743,2747 **** return (size_t)(-1); } ! fread(data, size_board, 1, input_file); printf("%s type: 0x%02x\n", board_type, len); printf("%s: ", board_type); --- 2743,2751 ---- return (size_t)(-1); } ! ret = fread(data, size_board, 1, input_file); ! if ((ret != 1) || ferror(input_file)) { ! lprintf(LOG_ERR, "Invalid board type size!"); ! goto out; ! } printf("%s type: 0x%02x\n", board_type, len); printf("%s: ", board_type); *************** *** 2764,2767 **** --- 2768,2772 ---- if (len == NO_MORE_INFO_FIELD) { unsigned char padding; + unsigned char checksum = 0; /* take the rest of data in the area minus 1 byte of * checksum *************** *** 2773,2781 **** fseek(input_file, padding, SEEK_CUR); } ! if (!feof(input_file)) { ! unsigned char checksum = 0; ! fread(&checksum, 1, 1, input_file); ! printf("Checksum: 0x%02x\n", checksum); } goto out; } --- 2778,2787 ---- fseek(input_file, padding, SEEK_CUR); } ! ret = fread(&checksum, 1, 1, input_file); ! if ((ret != 1) || ferror(input_file)) { ! lprintf(LOG_ERR, "Invalid Checksum!"); ! goto out; } + printf("Checksum: 0x%02x\n", checksum); goto out; } *************** *** 2790,2794 **** } ! fread(additional_data, size_board, 1, input_file); printf("Additional Custom Mfg. Data: %02x", additional_data[0]); --- 2796,2804 ---- } ! ret = fread(additional_data, size_board, 1, input_file); ! if ((ret != 1) || ferror(input_file)) { ! lprintf(LOG_ERR, "Invalid Additional Data!"); ! goto out; ! } printf("Additional Custom Mfg. Data: %02x", additional_data[0]); |