Skip to content
Snippets Groups Projects
Commit 10e2207b authored by Niels Möller's avatar Niels Möller
Browse files

(LDATA): Use sizeof instead of strlen. Now

handles strings including NUL-characters. But works only with
literals and character arrays, no char pointers.
(LLENGTH): New macro, computing length the same way as LDATA.

Rev: src/nettle/testsuite/testutils.h:1.16
parent 7f57807b
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,9 @@ test_dsa_key(struct dsa_public_key *pub,
#define H(x) decode_hex_dup(x)
#define HL(x) decode_hex_length(x), decode_hex_dup(x)
#define LDATA(x) strlen(x), x
/* LDATA needs to handle NUL characters. */
#define LLENGTH(x) (sizeof(x) - 1)
#define LDATA(x) (sizeof(x) - 1), x
#define LDUP(x) strlen(x), strdup(x)
#define MEMEQ(length, a, b) (!memcmp((a), (b), (length)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment