 <p>Uninitialized memory allocated by <code>new</code> won't behave nice with <code>strlen()</code>.</p> <p>It'd be better if one wrote:</p> <pre><code>memset(szBuf, 0, MAX_MSG * sizeof *szBuf); </code></pre> <p>You could also skip <code>sizeof *szBuf</code> since it's guaranteed to be 1, but it doesn't hurt.</p>