diff options
author | tb <> | 2025-05-18 06:41:51 +0000 |
---|---|---|
committer | tb <> | 2025-05-18 06:41:51 +0000 |
commit | 47df9c5ee5f6c874ba14ce2a46d5756a6e8865a5 (patch) | |
tree | b3ac9610decb6510946702141da1ca2caf6be005 /src | |
parent | d4dc360a42471cfed8ba84f17e83c2bb95afd2bb (diff) | |
download | openbsd-47df9c5ee5f6c874ba14ce2a46d5756a6e8865a5.tar.gz openbsd-47df9c5ee5f6c874ba14ce2a46d5756a6e8865a5.tar.bz2 openbsd-47df9c5ee5f6c874ba14ce2a46d5756a6e8865a5.zip |
bio_dump: only run strncmp if there's something to compare
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bio/bio_dump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/bio/bio_dump.c b/src/regress/lib/libcrypto/bio/bio_dump.c index 22db80fa3d..fd2bb285fb 100644 --- a/src/regress/lib/libcrypto/bio/bio_dump.c +++ b/src/regress/lib/libcrypto/bio/bio_dump.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bio_dump.c,v 1.4 2024/02/09 12:48:32 tb Exp $ */ | 1 | /* $OpenBSD: bio_dump.c,v 1.5 2025/05/18 06:41:51 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2024 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2024 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
@@ -809,7 +809,7 @@ bio_dump_test(const struct bio_dump_testcase *tc) | |||
809 | tc->indent, ret, got_len, strlen(tc->output)); | 809 | tc->indent, ret, got_len, strlen(tc->output)); |
810 | goto err; | 810 | goto err; |
811 | } | 811 | } |
812 | if (strncmp(tc->output, got, got_len) != 0) { | 812 | if (got_len > 0 && strncmp(tc->output, got, got_len) != 0) { |
813 | fprintf(stderr, "%d: mismatch\n", tc->indent); | 813 | fprintf(stderr, "%d: mismatch\n", tc->indent); |
814 | goto err; | 814 | goto err; |
815 | } | 815 | } |