Silence some warnings from pedantic static analysis tools, improve compatibility with C++.

C doesn't include the null in an array initilized from a
string literal if it doesn't fit, in C++ this is invalid.

The vararray style prototypes and init+calc also changed in
 this commit are not C89 enough for some tools.
This commit is contained in:
Gregory Maxwell
2015-01-26 05:26:09 +00:00
parent 3b7ea633fb
commit 27bc1311af
4 changed files with 9 additions and 5 deletions

View File

@@ -46,7 +46,7 @@ static void secp256k1_ecmult_gen_start(void) {
/* Construct a group element with no known corresponding scalar (nothing up my sleeve). */
{
static const unsigned char nums_b32[32] = "The scalar for this x is unknown";
static const unsigned char nums_b32[33] = "The scalar for this x is unknown";
secp256k1_fe_t nums_x;
secp256k1_ge_t nums_ge;
VERIFY_CHECK(secp256k1_fe_set_b32(&nums_x, nums_b32));