samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. (
/showthread.php?tid=473871)
[SOLVED] Assertion`fp!=((void *)0)' failed error. -
SilmiK - 04.11.2013
Fixed it I suppose thanks to ViruZz!
Re: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. -
ViruZz - 04.11.2013
Post the "AjailLog" function.
Could be overbuffer from the file variable.
Re: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. -
SilmiK - 04.11.2013
Fixed it I suppose thanks to ViruZz!
Re: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. -
ViruZz - 04.11.2013
Quote:
Originally Posted by SilmiK
pawn Код:
funktsioon AjailLog(string[]) { new entry[256]; format(entry, sizeof(entry), "%s\r\n",string); new File:hFile; hFile = fopen("GM/Logs/Ajail.log", io_append); fwrite(hFile, entry); fclose(hFile); return 1; }
|
Try this
pawn Код:
stock AjailLog(string[])
{
new szEntry[256], szFile: logfile;
format(szEntry, sizeof(szEntry), "%s\r\n", string);
if(logfile)
{
fclose(logfile);
}
if(!fexist("GM/Logs/Ajail.log"))
{
logfile = fopen("GM/Logs/Ajail.log", io_write);
}
else {
logfile = fopen("GM/Logs/Ajail.log", io_append);
}
if(logfile)
{
fwrite(logfile, szEntry);
fclose(logfile);
}
return 1;
}
It's because you're using Linux as your platform so the variable must be opened already with a previous file AKA overbuffer.
Re: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. -
SilmiK - 04.11.2013
Quote:
(12862) : warning 213: tag mismatch
(12866) : warning 213: tag mismatch
(12869) : warning 213: tag mismatch
(12874) : warning 213: tag mismatch
(12875) : warning 213: tag mismatch
|
These lines are:
Quote:
fclose(logfile);
logfile = fopen("GM/Logs/Ajail.log", io_write);
logfile = fopen("GM/Logs/Ajail.log", io_append);
fwrite(logfile, szEntry);
fclose(logfile);
|
Re: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. -
ViruZz - 04.11.2013
Quote:
Originally Posted by SilmiK
These lines are:
|
I failed, I just gave you my custom File identifier.
Replace
With
Re: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. -
SilmiK - 04.11.2013
Okay.
I guess I also found out what may had caused the issue aswell. I still rather write the logging functions as you've showed out here. Thanks!
I will +rep you right away.
Re: samp03svr: amx/amxfile.c:222: fputs_cell: Assertion `fp!=((void *)0)' failed. -
ViruZz - 04.11.2013
Quote:
Originally Posted by SilmiK
Okay.
I guess I also found out what may had caused the issue aswell. I still rather write the logging functions as you've showed out here. Thanks!
I will +rep you right away.
|
No problem.