fixed bug responsible for sending wrong checksums on windows systems

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5029 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-03-17 14:08:27 +00:00
parent b68e660a1c
commit 456177ef11
2 changed files with 18 additions and 5 deletions

View file

@ -47,7 +47,7 @@ int main(int argc,char *argv[])
return -1 ;
}
FILE *f = fopen(argv[1],"r") ;
FILE *f = RsDirUtil::rs_fopen(argv[1],"r") ;
if(f == NULL)
{
@ -75,6 +75,19 @@ int main(int argc,char *argv[])
Sha1CheckSum H(hash) ;
std::cerr << "Hashed transformed: " << H.toStdString() << std::endl;
std::cerr << "Computing all chunk hashes:" << std::endl;
fseek(f,0,SEEK_SET) ;
int n=0 ;
while(len = fread(buf,1,SIZE,f))
{
Sha1CheckSum sum = RsDirUtil::sha1sum(buf,len) ;
std::cerr << "Chunk " << n << ": " << sum.toStdString() << std::endl;
n++;
}
fclose(f) ;
return 0 ;
}