Don't try to write to an uninitialised file handle.

This commit is contained in:
Chris Young 2015-11-15 01:27:29 +00:00
parent e5a2538b6d
commit 28be6d2d79

View File

@ -650,11 +650,13 @@ static void ami_amiupdate(void)
char filename[1024];
BPTR amiupdatefh;
DevNameFromLock(lock,(STRPTR)&filename,1024L,DN_FULLPATH);
DevNameFromLock(lock, (STRPTR)&filename, 1024L, DN_FULLPATH);
if(amiupdatefh = FOpen("ENVARC:AppPaths/NetSurf", MODE_NEWFILE, 0)) {
FPuts(amiupdatefh, (CONST_STRPTR)&filename);
FClose(amiupdatefh);
}
amiupdatefh = FOpen("ENVARC:AppPaths/NetSurf",MODE_NEWFILE,0);
FPuts(amiupdatefh,(CONST_STRPTR)&filename);
FClose(amiupdatefh);
UnLock(lock);
}
}