10.10.2011, 03:18
Quote:
|
To fix the crashing with invalid specifiers, you should check what strftime returns I think, but I may go and modify the source on my own a little bit later to see.
Thanks! |
I tried and it does not work
pawn Код:
//native strftime(formato[],time[]);
static cell AMX_NATIVE_CALL n_strftime(AMX *amx, cell *params)
{
CHECK_PARAMS(2,"strftime");
time_t tiempo;
char buffer[80], *formato;
amx_StrParam(amx, params[1], formato);
struct tm *tmPtr;
tiempo = time(NULL);
tmPtr = localtime(&tiempo);
if(strftime( buffer, 80,formato, tmPtr ) == 0)
{
logprintf("STRFTIME: Especifier invalid");
return 0;
}
else
{
cell *time;
amx_GetAddr(amx,params[2],&time);
amx_SetString(time,buffer,0,0,sizeof(buffer));
return 1;
}
}

