fix time_t bugs.

This commit is contained in:
Matt
2015-01-29 19:08:27 -07:00
parent c9702d768c
commit e81b3a19ea

@ -2422,7 +2422,9 @@ bool Msg25::gotLinkText ( Msg20Request *req ) { // LinkTextReply *linkText ) {
// how many were filtered by LinkInfo::set()?
//int32_t inlinkingDocIdsFiltered2 = ng - m_linkInfo->getNumInlinks();
struct tm *timeStruct = localtime ( (time_t *)&m_lastUpdateTime );
time_t ttt;
struct tm *timeStruct = localtime ( &ttt );
m_lastUpdateTime = ttt;
char buf[64];
strftime ( buf, 64 , "%b-%d-%Y(%H:%M:%S)" , timeStruct );
@ -2831,16 +2833,18 @@ bool Msg25::gotLinkText ( Msg20Request *req ) { // LinkTextReply *linkText ) {
//if ( internal ) weight = 0.0;
// datedb date
char dbuf[128];
if ( r->m_datedbDate > 1 )
if ( r->m_datedbDate > 1 ) {
time_t ttt = (time_t)r->m_datedbDate;
sprintf(dbuf,"%s UTC",
asctime (gmtime((time_t *)&r->m_datedbDate )));
asctime (gmtime( &ttt )) );
}
else
sprintf(dbuf,"---");
char discBuf[128];
int32_t dd = r->m_discoveryDate;
time_t dd = (time_t)r->m_discoveryDate;
if ( dd ) {
struct tm *timeStruct = gmtime ( (time_t *)&dd );
struct tm *timeStruct = gmtime ( &dd );
strftime ( discBuf, 128 , "<nobr>%b %d %Y</nobr>" ,
timeStruct);
}
@ -2908,7 +2912,7 @@ bool Msg25::gotLinkText ( Msg20Request *req ) { // LinkTextReply *linkText ) {
"\t\t<siteRank>%"INT32"</siteRank>\n"
, (int32_t)internal
, dd
, (uint32_t)dd
, getLanguageString(r->m_language)
, (int32_t)r->m_siteRank
);