From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/wlib/mswlib/mswchksm.c | 125 --------------------------------------------- 1 file changed, 125 deletions(-) delete mode 100644 app/wlib/mswlib/mswchksm.c (limited to 'app/wlib/mswlib/mswchksm.c') diff --git a/app/wlib/mswlib/mswchksm.c b/app/wlib/mswlib/mswchksm.c deleted file mode 100644 index 602c204..0000000 --- a/app/wlib/mswlib/mswchksm.c +++ /dev/null @@ -1,125 +0,0 @@ -#include -#include -#include "../include/wlib.h" -#ifdef WINDOWS -#include -#include "mswint.h" -#endif - -#define HEWHDROFFSET (0x3C) - -static FILE * openfile( const char * fn, const char * mode, long * fileSize ) -{ - unsigned short PageCnt; - long FileSize; - FILE *fp; - struct stat Stat; - fp = fopen( fn, mode ); - if (fp == NULL) { - perror( "fopen" ); - return NULL; - } - fread( &PageCnt, sizeof(PageCnt), 1, fp ); /* Read past signature */ - fread( &PageCnt, sizeof(PageCnt), 1, fp ); /* Read past pagesize */ - FileSize = PageCnt; - fread( &PageCnt, sizeof(PageCnt), 1, fp ); /* Read past pagesize */ - if ( FileSize == 0L ) - FileSize = PageCnt * 512L; - else - FileSize += (PageCnt - 1) * 512L; - *fileSize = FileSize; - stat( fn, &Stat ); - *fileSize = (long)Stat.st_size; - fprintf( stderr, "size1 = %ld, size2 = %ld\n", FileSize, (long)Stat.st_size ); - return fp; -} - - -static unsigned short mswCheck16( FILE * fp, long FileSize, unsigned short * sum16stored ) -{ - unsigned short int sum16, NxtInt; - long x; - unsigned char NxtChar; - sum16 = 0; - fseek(fp, 0, SEEK_SET); - - for (x=0L; x