mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
file_checksum() shouldn't crash if it can't open the file.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@896 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
c67e6a1b8c
commit
1ca99a108c
@ -226,6 +226,8 @@ static unsigned int file_checksum(const char *fname)
|
||||
unsigned int checksum = 0;
|
||||
|
||||
f = fopen(fname, "rb");
|
||||
if (f == NULL) return 0;
|
||||
|
||||
while (!feof(f))
|
||||
checksum += fgetc(f) << ((n++ & 3)*8);
|
||||
fclose(f);
|
||||
|
Loading…
Reference in New Issue
Block a user