Permalink
Browse files

OS X compatibility.

  • Loading branch information...
1 parent 99465a2 commit d488baa85aa8521ef74a031ae4a54876eb55870f @rescrv committed Dec 8, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 buffer.cc
View
@@ -73,7 +73,11 @@ e :: buffer :: index(const uint8_t* mem, size_t sz) const throw ()
{
const uint8_t* loc = static_cast<const uint8_t*>(memmem(m_data, m_size, mem, sz));
- if (loc == NULL)
+ if (sz == 0)
+ {
+ return 0;
+ }
+ else if (loc == NULL)
{
return m_cap;
}

0 comments on commit d488baa

Please sign in to comment.