See the discussion here: <a href="https:&#x2F;&#x2F;utcc.utoronto.ca&#x2F;~cks&#x2F;space&#x2F;blog&#x2F;programming&#x2F;CNullStringsDefense" rel="nofollow">https:&#x2F;&#x2F;utcc.utoronto.ca&#x2F;~cks&#x2F;space&#x2F;blog&#x2F;programming&#x2F;CNullSt...</a><p>Also why store the length twice?  The whole point of my article is that malloc already stores the length, you don&#x27;t need to store it over again.