There is a bug in the code in function md5File circa line 214 (fread() call). When used passing a file as a parameter, the file never gets open nor closed.
UDPDATE: Never mind. I understand your code wrong. I assumed that your main.c test code would have a syntax like md5sum tool
In any case, as as suggestion, in my opinion md5File() should only handle files (either passing their names to it or the stdin).
Thanks for posting this code, btw.
There is a bug in the code in function md5File circa line 214 (fread() call). When used passing a file as a parameter, the file never gets open nor closed.
UDPDATE: Never mind. I understand your code wrong. I assumed that your main.c test code would have a syntax like md5sum tool
In any case, as as suggestion, in my opinion md5File() should only handle files (either passing their names to it or the stdin).
Thanks for posting this code, btw.