fwrite crashes server
#1

Hi,

Whenever I attempt to start up the samp-server I get a native fwrite crash:

[debug] AMX backtrace:
[debug] #0 native fwrite () [00405710] from samp-server.exe

Any ideas how to resolve this issue? I have tried to search on the sa-mp forums and elsewhere however so far I have not yet found a solution.


Regards,

Hotelgast
Reply
#2

https://sampwiki.blast.hk/wiki/Fwrite

By checking if the file handle is valid, it prevents the crash. So instead of doing this:
pawn Код:
new File: fhandle = fopen(...);
fwrite(fhandle, "...");
fclose(fhandle);
would be:
pawn Код:
new File: fhandle = fopen(...);
if (fhandle)
{
    fwrite(fhandle, "...");
    fclose(fhandle);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)