From 8a8b40f74f9b56b3d3fd333227c62c80d71a639f Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Wed, 10 Jun 2020 18:43:38 +0200 Subject: [PATCH] Fix memset call in xdl/data_io/packer/pack_feature The `void *memset(void *s, int c, size_t n)` function takes the value to fill in its 2nd argument and the number of byte to fill in in 3rd. This commit fixes an invalid use of `memset` which had the two arguments swapped and it did not set any memory at all in the end due to that. --- xdl/xdl/data_io/packer/pack_feature.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdl/xdl/data_io/packer/pack_feature.cc b/xdl/xdl/data_io/packer/pack_feature.cc index f7f3c0fd..70d6c8cc 100644 --- a/xdl/xdl/data_io/packer/pack_feature.cc +++ b/xdl/xdl/data_io/packer/pack_feature.cc @@ -354,7 +354,7 @@ std::pair PackFeature::Run(const PParam &pparam) { } std::vector feature_hits(tstat.seq_.size()); - memset(&feature_hits[0], feature_hits.size(), 0); + memset(&feature_hits[0], 0, feature_hits.size()); /// foreach feature for (auto &f: fl.features()) {