diff --git a/examples/schnorr.c b/examples/schnorr.c index 326e830169..6f34f599ab 100644 --- a/examples/schnorr.c +++ b/examples/schnorr.c @@ -52,7 +52,7 @@ int main(void) { } /* Try to create a keypair with a valid context, it should only fail if * the secret key is zero or out of range. */ - if (secp256k1_keypair_create(ctx, &keypair, seckey)) { + if (!secp256k1_keypair_create(ctx, &keypair, seckey)) { printf("Generated secret key is invalid. This indicates an issue with the random number generator.\n"); return 1; }