From 4bc11d6cf8d28c890dc029fa9318cc0d3b6e870b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 8 Mar 2006 01:58:01 +0000 Subject: kill off gcc signed warnings --- libcrypt/md5.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libcrypt') diff --git a/libcrypt/md5.c b/libcrypt/md5.c index 989d4482c..412c8bfb5 100644 --- a/libcrypt/md5.c +++ b/libcrypt/md5.c @@ -94,12 +94,19 @@ static void __md5_Final (unsigned char [16], struct MD5Context *); static void __md5_Transform __P((u_int32_t [4], const unsigned char [64])); -static const char __md5__magic[] = "$1$"; /* This string is magic for this algorithm. Having +static const unsigned char __md5__magic[] = "$1$"; /* This string is magic for this algorithm. Having it this way, we can get better later on */ static const unsigned char __md5_itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +/* shut up gcc-4.x signed warnings */ +#define strcpy(dst,src) strcpy((char*)dst,(char*)src) +#define strlen(s) strlen((char*)s) +#define strncat(dst,src,n) strncat((char*)dst,(char*)src,n) +#define strncmp(s1,s2,n) strncmp((char*)s1,(char*)s2,n) + + #ifdef i386 #define __md5_Encode memcpy @@ -531,11 +538,11 @@ static void __md5_to64( char *s, unsigned long v, int n) * Use MD5 for what it is best at... */ -char * __md5_crypt( const char *pw, const char *salt) attribute_hidden; -char * __md5_crypt( const char *pw, const char *salt) +char * __md5_crypt( const unsigned char *pw, const unsigned char *salt) attribute_hidden; +char * __md5_crypt( const unsigned char *pw, const unsigned char *salt) { /* Static stuff */ - static const char *sp, *ep; + static const unsigned char *sp, *ep; static char passwd[120], *p; unsigned char final[17]; /* final[16] exists only to aid in looping */ -- cgit v1.2.3