Function crash the server.
#7

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
What do you mean by "pos" ?
Код:
new File:pos=fopen(file, io_append);
if the value of "pos" variable is 0 and is used in fwrite will crash the server. To prevent it:
pawn Код:
new File:pos=fopen(file, io_append);
if (!pos) return;
but since it won't open the file, it won't write either. You may as well add return values like if pos is 0, return 0 otherwise 1 and if you do:
pawn Код:
if (!WriteLogs(...)) ...
you can print in the console that it failed to open the file etc.
Reply


Messages In This Thread
Function crash the server. - by Dayrion - 21.06.2016, 15:44
Re: Function crash the server. - by ATGOggy - 21.06.2016, 15:47
Re: Function crash the server. - by Dayrion - 21.06.2016, 15:49
Re: Function crash the server. - by Konstantinos - 21.06.2016, 15:51
Re: Function crash the server. - by Dayrion - 21.06.2016, 16:00
Re: Function crash the server. - by jlalt - 21.06.2016, 16:04
Re: Function crash the server. - by Konstantinos - 21.06.2016, 16:08
Re: Function crash the server. - by SecretBoss - 21.06.2016, 16:12
Re: Function crash the server. - by Dayrion - 21.06.2016, 16:33
Re: Function crash the server. - by Dayrion - 21.06.2016, 17:25

Forum Jump:


Users browsing this thread: 1 Guest(s)