
< 		if (metachar(*p))
---
> 		if (p < s + slen && metachar(*p))
