check fopen
This commit is contained in:
parent
0dbea3b69f
commit
44d14a398d
@ -16,6 +16,7 @@ int main(void)
|
|||||||
mp_init_multi(&q, &p, NULL);
|
mp_init_multi(&q, &p, NULL);
|
||||||
|
|
||||||
out = fopen("2kprime.1", "w");
|
out = fopen("2kprime.1", "w");
|
||||||
|
if (out != NULL) {
|
||||||
for (x = 0; x < (int)(sizeof(sizes) / sizeof(sizes[0])); x++) {
|
for (x = 0; x < (int)(sizeof(sizes) / sizeof(sizes[0])); x++) {
|
||||||
top:
|
top:
|
||||||
mp_2expt(&q, sizes[x]);
|
mp_2expt(&q, sizes[x]);
|
||||||
@ -73,6 +74,7 @@ top:
|
|||||||
fflush(out);
|
fflush(out);
|
||||||
}
|
}
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ int main(void)
|
|||||||
mp_init(&b);
|
mp_init(&b);
|
||||||
|
|
||||||
out = fopen("drprimes.txt", "w");
|
out = fopen("drprimes.txt", "w");
|
||||||
|
if (out != NULL) {
|
||||||
for (x = 0; x < (int)(sizeof(sizes)/sizeof(sizes[0])); x++) {
|
for (x = 0; x < (int)(sizeof(sizes)/sizeof(sizes[0])); x++) {
|
||||||
top:
|
top:
|
||||||
printf("Seeking a %d-bit safe prime\n", sizes[x] * DIGIT_BIT);
|
printf("Seeking a %d-bit safe prime\n", sizes[x] * DIGIT_BIT);
|
||||||
@ -56,6 +57,7 @@ top:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
}
|
||||||
|
|
||||||
mp_clear(&a);
|
mp_clear(&a);
|
||||||
mp_clear(&b);
|
mp_clear(&b);
|
||||||
|
@ -36,6 +36,7 @@ static void gen_prime(void)
|
|||||||
FILE *out;
|
FILE *out;
|
||||||
|
|
||||||
out = fopen("pprime.dat", "wb");
|
out = fopen("pprime.dat", "wb");
|
||||||
|
if (out != NULL) {
|
||||||
|
|
||||||
/* write first set of primes */
|
/* write first set of primes */
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
@ -150,6 +151,7 @@ static void gen_prime(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void load_tab(void)
|
static void load_tab(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user