Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
f7bb872e
by Alexei Podtelezhnikov at 2021-09-09T22:38:19-04:00
1 changed file:
Changes:
... | ... | @@ -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 );
|