From 446f334cc1ee67b280e218ae58fef34d5b063cea Mon Sep 17 00:00:00 2001 From: dscho Date: Sat, 6 Oct 2001 17:45:42 +0000 Subject: WIN32 compatibility, removed kbdptr.c --- vncauth.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'vncauth.c') diff --git a/vncauth.c b/vncauth.c index 75f1cc3..1014291 100644 --- a/vncauth.c +++ b/vncauth.c @@ -26,7 +26,13 @@ #include #include #include +#ifdef WIN32 +#include +#define srandom srand +#define random rand +#else #include +#endif #include "rfb.h" #include "d3des.h" @@ -49,12 +55,15 @@ int vncEncryptAndStorePasswd(char *passwd, char *fname) { FILE *fp; - int i; + unsigned int i; unsigned char encryptedPasswd[8]; if ((fp = fopen(fname,"w")) == NULL) return 1; + /* windows security sux */ +#ifndef WIN32 chmod(fname, S_IRUSR|S_IWUSR); +#endif /* pad password with nulls */ @@ -142,7 +151,7 @@ void vncEncryptBytes(unsigned char *bytes, char *passwd) { unsigned char key[8]; - int i; + unsigned int i; /* key is simply password padded with nulls */ -- cgit v1.2.1