From 1ca99a108caacc74cb9fc358217e2941da1208c6 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 29 Nov 2000 16:05:15 +0000 Subject: 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 --- src/core/settings.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/settings.c') 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); -- cgit v1.2.3