Show
Ignore:
Timestamp:
10/18/06 09:00:22 (2 years ago)
Author:
jordi
Message:

When setting the PDF metadata, I did trust the result of localtime and
the strftime() function then failed. This prevented in some cases to
load the document and even to print it (!).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/PDFDocument.cxx

    r256 r257  
    320320    { 
    321321        struct tm *tmpTime = localtime ((const time_t *)&creationDate); 
    322         gchar *date = g_strnfill (DATE_LENGTH + 1, 0); 
    323         strftime (date, DATE_LENGTH, "%Y-%m-%d %H:%M:%S", tmpTime); 
    324         setCreationDate (date); 
     322    if ( NULL != tmpTime ) 
     323    { 
     324            gchar *date = g_strnfill (DATE_LENGTH + 1, 0); 
     325            strftime (date, DATE_LENGTH, "%Y-%m-%d %H:%M:%S", tmpTime); 
     326            setCreationDate (date); 
     327    } 
    325328    } 
    326329    else 
     
    335338    { 
    336339        struct tm *tmpTime = localtime ((const time_t *)&modDate); 
    337         gchar *date = g_strnfill (DATE_LENGTH + 1, 0); 
    338         strftime (date, DATE_LENGTH, "%Y-%m-%d %H:%M:%S", tmpTime); 
    339         setModifiedDate (date); 
     340    if ( NULL != tmpTime ) 
     341    { 
     342        gchar *date = g_strnfill (DATE_LENGTH + 1, 0); 
     343            strftime (date, DATE_LENGTH, "%Y-%m-%d %H:%M:%S", tmpTime); 
     344            setModifiedDate (date); 
     345    } 
    340346    } 
    341347    else