diff options
author | Timo Sirainen <cras@irssi.org> | 2000-11-29 16:05:15 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-11-29 16:05:15 +0000 |
commit | 1ca99a108caacc74cb9fc358217e2941da1208c6 (patch) | |
tree | 955c1b356bccc6b28f6152e52f2536e079b651fc /src/core/settings.c | |
parent | c67e6a1b8c1cd964d4614d154d798b4871064c49 (diff) | |
download | irssi-1ca99a108caacc74cb9fc358217e2941da1208c6.zip |
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
Diffstat (limited to 'src/core/settings.c')
-rw-r--r-- | src/core/settings.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/settings.c b/src/core/settings.c index 6959453a..926b1120 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -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); |