Jakub Wilk writes:
> mpz_set_str() works only on objects that are already initialized.
> You want mpz_init_set_str() instead.
> Also, it should probably be argv[j + 1].
Oh gosh, herp derp. My apologies for the noise.
--
µ.
--
debian-science-maintainers mailing list
debian-science-maintainers
* Michele Orru` , 2016-04-10, 13:33:
for (int j = 0; j < argc-1; ++j) {
mpz_set_str(key[j], argv[j], 2);
mpz_set_str() works only on objects that are already initialized.
You want mpz_init_set_str() instead.
Also, it should probably be argv[j + 1].
--
Jakub Wilk
--
debian-science-maintain
Package: libgmp-dev
Version: 2:6.1.0+dfsg-2
Severity: normal
Tags: upstream
Dear Maintainer,
Given the following code:
8<
#include
#include
int main(int argc, char **argv)
{
if (argc < 2) {
return EXIT_FAILURE;
}
mpz_t key[argc-1];
for (int j = 0; j < argc-1; ++j) {