Skip to content

Commit 7d779c6

Browse files
examples/musig: use brace-enclosed initializer for 32-byte msg
Switch msg initialization from a string literal to a brace-enclosed array to avoid -Wunterminated-string-initialization. Upstream removed the trailing '!' from the message; this change retains it.
1 parent 53fd89b commit 7d779c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/musig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int sign(const secp256k1_context* ctx, struct signer_secrets *signer_secr
169169
const secp256k1_pubkey *pubkeys_ptr[N_SIGNERS];
170170
secp256k1_xonly_pubkey agg_pk;
171171
secp256k1_musig_keyagg_cache cache;
172-
unsigned char msg[32] = "this_could_be_the_hash_of_a_msg!";
172+
unsigned char msg[] = {'t', 'h', 'i', 's', '_', 'c', 'o', 'u', 'l', 'd', ' ', 'b', 'e', ' ', 't', 'h', 'e', '_', 'h', 'a', 's', 'h', '_', 'o', 'f', '_', 'a', '_', 'm', 's', 'g', '!'};
173173
unsigned char sig[64];
174174

175175
/* Create a secp256k1 context */

0 commit comments

Comments
 (0)