Fix computation of extracted string length

This was causing the assertion failure seen in #14.  (Aside: I want to start a discussion of C vs. C++ here in a bit .. ;).)