Skip to content

Commit

Permalink
0.2b
Browse files Browse the repository at this point in the history
  • Loading branch information
creaktive committed Jul 19, 2003
1 parent f8c911f commit 45f8165
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Readme.txt
@@ -1,4 +1,4 @@
MD5/SHA1 checksum generator/checker v0.2a for Total Commander
MD5/SHA1 checksum generator/checker v0.2b for Total Commander
=============================================================


Expand Down Expand Up @@ -98,6 +98,8 @@ same, just replace every "md5" you see by "sha" :)
* replaced is*() functions from runtime by c00l macro hacks
* fixed memory leak in parser
* added ChangeLog :)
- v0.2b
* removed FILE_SHARE_DELETE flag from CreateFile() as it's NT-specific


* TODO:
Expand Down
2 changes: 1 addition & 1 deletion checksum.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion parser.h
Expand Up @@ -25,8 +25,9 @@
#ifndef _PARSER_H
#define _PARSER_H

//#include <ctype.h>
/* eradicate "Microsoft Visual C++ Runtime Library" */
#ifdef NO_RUNTIME

#undef isspace
#define isspace(c) (((c>=0x9&&c<=0xd)||(c==0x20))?1:0)
#undef isxdigit
Expand All @@ -36,6 +37,12 @@
#undef tolower
#define tolower(c) ((c>='A'&&c<='Z')?(c+('a'-'A')):c)

#else

#include <ctype.h>

#endif

#include <malloc.h>
#include <memory.h>
#include <stdio.h>
Expand Down
8 changes: 5 additions & 3 deletions wcx.c
Expand Up @@ -24,9 +24,11 @@

/* non-critical optimizations (combine with UPX :) */

#ifdef NO_RUNTIME
#pragma comment(linker,"/ENTRY:DllMain")
#pragma comment(linker,"/NODEFAULTLIB:libcmt.lib")
#pragma comment(lib,"msvcrt.lib")
#endif

#define WIN32_LEAN_AND_MEAN

Expand All @@ -39,7 +41,7 @@


#define SUM_BUFSIZE 32768
#define VERSION "v0.2a"
#define VERSION "v0.2b"


typedef struct
Expand Down Expand Up @@ -168,7 +170,7 @@ char *md5sum(char *filename)
unsigned char keybuf[16];
char *checksum, *p;

if ((h = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ+FILE_SHARE_WRITE+FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
if ((h = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ+FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
return NULL;

buf = (char *) malloc(SUM_BUFSIZE);
Expand Down Expand Up @@ -204,7 +206,7 @@ char *sha1sum(char *filename)
unsigned char keybuf[20];
char *checksum, *p;

if ((h = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ+FILE_SHARE_WRITE+FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
if ((h = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ+FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
return NULL;

buf = (char *) malloc(SUM_BUFSIZE);
Expand Down

0 comments on commit 45f8165

Please sign in to comment.