Skip to content

Commit 1e2d773

Browse files
sergio-nsknmoinvaz
authored andcommitted
Fix test crypt.rand: random_bytes[0] can be 0, std::string(random_bytes)
gets empty C string.
1 parent 87205f4 commit 1e2d773

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_crypt.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ TEST(crypt, rand) {
4444

4545
EXPECT_EQ(mz_crypt_rand(random_bytes, sizeof(random_bytes)), sizeof(random_bytes));
4646

47-
EXPECT_NE(std::string((char *)random_bytes).find_first_not_of('\0'), std::string::npos);
47+
EXPECT_NE(std::string((char *)random_bytes, sizeof(random_bytes)).find_first_not_of('\0'), std::string::npos);
4848
}
4949

5050
TEST(crypt, sha1) {

0 commit comments

Comments
 (0)