freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][master] * src/ftdump.c (Print_Name): Igno


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] * src/ftdump.c (Print_Name): Ignore negative pre-epoch time.
Date: Fri, 10 Sep 2021 02:39:20 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

1 changed file:

Changes:

  • src/ftdump.c
    ... ... @@ -160,16 +160,17 @@
    160 160
           modified = head->Modified[0] == 1 ? modified + 2212122496U
    
    161 161
                                             : modified - 2082844800U;
    
    162 162
     
    
    163
    -      /* gmtime cannot deal with negative times on some systems */
    
    164
    -      if ( created  < 0 )
    
    165
    -        created  = 0;
    
    166
    -      if ( modified < 0 )
    
    167
    -        modified = 0;
    
    168
    -
    
    169
    -      strftime( buf, sizeof ( buf ), "%Y-%m-%d", gmtime( &created  ) );
    
    170
    -      printf( "%s%s\n", Name_Field( "created" ), buf );
    
    171
    -      strftime( buf, sizeof ( buf ), "%Y-%m-%d", gmtime( &modified ) );
    
    172
    -      printf( "%s%s\n", Name_Field( "modified" ), buf );
    
    163
    +      /* ignore pre-epoch time that gmtime cannot handle on some systems */
    
    164
    +      if ( created  >= 0 )
    
    165
    +      {
    
    166
    +        strftime( buf, sizeof ( buf ), "%Y-%m-%d", gmtime( &created  ) );
    
    167
    +        printf( "%s%s\n", Name_Field( "created" ), buf );
    
    168
    +      }
    
    169
    +      if ( modified >= 0 )
    
    170
    +      {
    
    171
    +        strftime( buf, sizeof ( buf ), "%Y-%m-%d", gmtime( &modified ) );
    
    172
    +        printf( "%s%s\n", Name_Field( "modified" ), buf );
    
    173
    +      }
    
    173 174
     
    
    174 175
           printf( "%s%.2f\n", Name_Field( "revision" ),
    
    175 176
                   head->Font_Revision / 65536.0 );
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]