diff --git a/harbour/ChangeLog b/harbour/ChangeLog index dfefa239d8..2dce4a0039 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-07-15 20:37 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/hbmd5.c + ! fixed MD5 calculations + 2008-07-15 14:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbmysql/Makefile * harbour/contrib/hbodbc/Makefile diff --git a/harbour/source/rtl/hbmd5.c b/harbour/source/rtl/hbmd5.c index 1011c11443..720c57289b 100644 --- a/harbour/source/rtl/hbmd5.c +++ b/harbour/source/rtl/hbmd5.c @@ -9,7 +9,7 @@ * Copyright 2004 Dmitry V. Korzhov * * Copyright 2007 Przemyslaw Czerpak - * updated and for current Harbour code, other then x86@32 machines, + * updated for current Harbour code, other then x86@32 machines, * files and buffers longer then 2^32 and some fixes * * www - http://www.harbour-project.org @@ -297,7 +297,7 @@ HB_EXPORT void hb_md5( BYTE * ucData, ULONG ulLen, BYTE * ucDigest ) memcpy( buf + n, pad, 64 ); /* count bits length */ i = 56; - if( n > 56 ) + if( n >= 56 ) { i += 64; memcpy( md5.buf, buf, 64 ); @@ -350,7 +350,7 @@ HB_EXPORT void hb_md5file( FHANDLE hFile, BYTE * ucDigest ) memcpy( buf, readbuf + i, n ); memcpy( buf + n, pad, 64 ); i = 56; - if( n > 56 ) + if( n >= 56 ) { i += 64; memcpy( md5.buf, buf, 64 );