kopia lustrzana https://github.com/Hamlib/Hamlib
rodzic
fabfe61a45
commit
9ed13add01
|
@ -6,28 +6,40 @@ Does fail when compiled with gcc -m32 -o 2038 2038.c
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int main(void)
|
int test2038(void)
|
||||||
{
|
{
|
||||||
time_t x;
|
time_t x;
|
||||||
|
|
||||||
|
//printf("sizeof(time_t)=%d\n", (int)sizeof(time_t));
|
||||||
|
|
||||||
x = (time_t)((1U << 31) - 1);
|
x = (time_t)((1U << 31) - 1);
|
||||||
|
//printf("x=%lu\n", (unsigned long)x);
|
||||||
char *s = ctime(&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; }
|
if (!strstr(s, "2038")) { return 1; }
|
||||||
|
|
||||||
x += 1;
|
x += 1;
|
||||||
s = ctime(&x);
|
s = ctime(&x);
|
||||||
|
|
||||||
|
//printf("x=%lu\n", (unsigned long)x);
|
||||||
|
//printf("%s\n", s);
|
||||||
if (!strstr(s, "2038")) { return 1; }
|
if (!strstr(s, "2038")) { return 1; }
|
||||||
|
|
||||||
//printf("%s", s);
|
//printf("x=%lu\n", (unsigned long)x);
|
||||||
|
//printf("%s\n", s);
|
||||||
x += 1;
|
x += 1;
|
||||||
s = ctime(&x);
|
s = ctime(&x);
|
||||||
|
|
||||||
if (!strstr(s, "2038")) { return 1; }
|
if (!strstr(s, "2038")) { return 1; }
|
||||||
|
|
||||||
//printf("%s", s);
|
//printf("%s\n", s);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return test2038();
|
||||||
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue