Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1f70ab

Browse files
committed
try to fix nonnull warning firing off on older gcc
1 parent 08ca6dd commit c1f70ab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bitreader/test/gtest_common.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ namespace {
4242
size_t to_copy = std::min(_data.size() - position, bytes);
4343
auto begin = _data.begin() + position;
4444
auto end = begin + to_copy;
45-
std::copy(begin, end, dest);
45+
if (!dest)
46+
{
47+
to_copy = 0;
48+
}
49+
else
50+
{
51+
std::copy(begin, end, dest);
52+
}
4653
return to_copy;
4754
}
4855

0 commit comments

Comments
 (0)