diff options
Diffstat (limited to 'lib/marisa/mapper.cc')
-rw-r--r-- | lib/marisa/mapper.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/marisa/mapper.cc b/lib/marisa/mapper.cc index c03373c..4562a6d 100644 --- a/lib/marisa/mapper.cc +++ b/lib/marisa/mapper.cc @@ -22,7 +22,7 @@ Mapper::Mapper() Mapper::Mapper(const void *ptr, std::size_t size) : ptr_(ptr), origin_(NULL), avail_(size), size_(0), file_(NULL), map_(NULL) { - MARISA_THROW_IF((ptr != NULL) && (size != 0), MARISA_PARAM_ERROR); + MARISA_THROW_IF((ptr == NULL) || (size == 0), MARISA_PARAM_ERROR); } #else // defined _WIN32 || defined _WIN64 Mapper::Mapper() @@ -30,7 +30,7 @@ Mapper::Mapper() Mapper::Mapper(const void *ptr, std::size_t size) : ptr_(ptr), origin_(MAP_FAILED), avail_(size), size_(0), fd_(-1) { - MARISA_THROW_IF((ptr != NULL) && (size != 0), MARISA_PARAM_ERROR); + MARISA_THROW_IF((ptr == NULL) || (size == 0), MARISA_PARAM_ERROR); } #endif // defined _WIN32 || defined _WIN64 |