Subject: | Crypt-UnixCrypt_XS-0.05 compile problem with NetWare/Win32 platform |
Date: | Tue, 15 May 2007 14:46:42 +0200 |
To: | bug-Crypt-UnixCrypt_XS [...] rt.cpan.org |
From: | Guenter Knauf <info [...] gknw.de> |
Hi,
the fcrypt lib has few minor probs when compiling with non-gcc compilers:
vars are not allowed in the middle of the code; therefore I moved declaration of int i up.
Inclusion of string.h is necessary to get the prototype for memset().
--- fcrypt.c.orig Fri Feb 11 19:27:46 2005
+++ fcrypt.c Tue May 15 14:37:48 2007
@@ -623,8 +623,8 @@
const char *password,
size_t passwordlen)
{
- if(passwordlen > 8) passwordlen = 8;
int i;
+ if(passwordlen > 8) passwordlen = 8;
for (i=0; i<passwordlen; i++)
key[i] = ((unsigned char)password[i]) << 1;
for (; i<8; i++)
@@ -660,7 +660,6 @@
unsigned long saltnum;
unsigned long nrounds;
des_cblock block, key;
- int i;
if(saltlen == 0)
{
##############################################################################
--- fcrypt.h.orig Fri Feb 11 19:27:46 2005
+++ fcrypt.h Tue May 15 14:37:48 2007
@@ -1,4 +1,5 @@
#include <stddef.h>
+#include <string.h>
typedef unsigned char des_cblock[8];
greets, Guenter.