Sorry, I had to read your comment about strnlen a couple of times to grok that you were using str*n*len. Disregard this.