mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 10:27:18 +00:00
parent
fabfe61a45
commit
9ed13add01
@ -6,28 +6,40 @@ Does fail when compiled with gcc -m32 -o 2038 2038.c
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void)
|
||||
int test2038(void)
|
||||
{
|
||||
time_t x;
|
||||
|
||||
//printf("sizeof(time_t)=%d\n", (int)sizeof(time_t));
|
||||
|
||||
x = (time_t)((1U << 31) - 1);
|
||||
//printf("x=%lu\n", (unsigned long)x);
|
||||
char *s = ctime(&x);
|
||||
|
||||
//printf("%s", s);
|
||||
//printf("%s\n", s);
|
||||
//printf("x=%lu\n", (unsigned long)x);
|
||||
if (!strstr(s, "2038")) { return 1; }
|
||||
|
||||
x += 1;
|
||||
s = ctime(&x);
|
||||
|
||||
//printf("x=%lu\n", (unsigned long)x);
|
||||
//printf("%s\n", s);
|
||||
if (!strstr(s, "2038")) { return 1; }
|
||||
|
||||
//printf("%s", s);
|
||||
//printf("x=%lu\n", (unsigned long)x);
|
||||
//printf("%s\n", s);
|
||||
x += 1;
|
||||
s = ctime(&x);
|
||||
|
||||
if (!strstr(s, "2038")) { return 1; }
|
||||
|
||||
//printf("%s", s);
|
||||
//printf("%s\n", s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return test2038();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user