title: Correct implementation of Boyer Moore algorithm
body: <p>I tried to use several implementations, but all of them had bugs.<br>
  Search at SO gave me <a href="http://www-igm.univ-mlv.fr/~lecroq/string/node14.html" rel="nofollow noreferrer">http://www-igm.univ-mlv.fr/~lecroq/string/node14.html</a> - looks nice, but this implementation gave me wrong results - sometimes it doesn't found a string.<br>
  I spent couple hours to find the bug.</p>
  
  <p>Following line looks fine:</p>
  
  <pre><code>j += MAX(bmGs[i], bmBc[y[i + j]] - m + 1 + i);
  </code></pre>
  
  <p>but <em>y</em> is char * and char is <strong>signed</strong>! It means that y[i + j] could be negative (what happens in one of my tests).  </p>
  
  <p>My question is: Where to find correct implementation of Boyer Moore algorithm?</p>