mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -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;
|
unsigned int checksum = 0;
|
||||||
|
|
||||||
f = fopen(fname, "rb");
|
f = fopen(fname, "rb");
|
||||||
|
if (f == NULL) return 0;
|
||||||
|
|
||||||
while (!feof(f))
|
while (!feof(f))
|
||||||
checksum += fgetc(f) << ((n++ & 3)*8);
|
checksum += fgetc(f) << ((n++ & 3)*8);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
Loading…
Reference in New Issue
Block a user