diff options
| author | tb <> | 2025-05-18 06:41:51 +0000 |
|---|---|---|
| committer | tb <> | 2025-05-18 06:41:51 +0000 |
| commit | dfeaa842f2015d266bd7922b89795a2007e6f497 (patch) | |
| tree | b3ac9610decb6510946702141da1ca2caf6be005 /src/regress/lib | |
| parent | af1ef3c1489da1809c2ff641297daa2a8c023e75 (diff) | |
| download | openbsd-dfeaa842f2015d266bd7922b89795a2007e6f497.tar.gz openbsd-dfeaa842f2015d266bd7922b89795a2007e6f497.tar.bz2 openbsd-dfeaa842f2015d266bd7922b89795a2007e6f497.zip | |
bio_dump: only run strncmp if there's something to compare
Diffstat (limited to 'src/regress/lib')
| -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 | } |
