summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/MD5.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/kwsys/MD5.c')
-rw-r--r--Source/kwsys/MD5.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/kwsys/MD5.c b/Source/kwsys/MD5.c
index 56776a3..a147057 100644
--- a/Source/kwsys/MD5.c
+++ b/Source/kwsys/MD5.c
@@ -478,11 +478,16 @@ void kwsysMD5_Initialize(kwsysMD5* md5)
/*--------------------------------------------------------------------------*/
void kwsysMD5_Append(kwsysMD5* md5, unsigned char const* data, int length)
{
+ size_t dlen;
if(length < 0)
{
- length = (int)strlen((char const*)data);
+ dlen = strlen((char const*)data);
}
- md5_append(&md5->md5_state, (md5_byte_t const*)data, (size_t)length);
+ else
+ {
+ dlen = (size_t)length;
+ }
+ md5_append(&md5->md5_state, (md5_byte_t const*)data, dlen);
}
/*--------------------------------------------------------------------------*/