Crash on localtime struct
Seems localtime struct ptr is not being returned, thus we crash (might be something with my environment), however for now adding a check to stop us from crashing.
This commit is contained in:
parent
c4f9c92303
commit
e5876f9a10
4 changed files with 6 additions and 1 deletions
|
@ -138,7 +138,12 @@ void EQPacket::DumpRawHeader(uint16 seq, FILE *to) const
|
|||
{
|
||||
if (timestamp.tv_sec) {
|
||||
char temp[20];
|
||||
strftime(temp,20,"%F %T",localtime((const time_t *)×tamp.tv_sec));
|
||||
struct tm* info = localtime((const time_t*)×tamp.tv_sec);
|
||||
if (info)
|
||||
strftime(temp, 20, "%F %T", info);
|
||||
else
|
||||
_snprintf(temp, 20, "[UNKNOWNTIME]");
|
||||
|
||||
fprintf(to, "%s.%06lu ",temp,timestamp.tv_usec);
|
||||
}
|
||||
if (src_ip) {
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue