Strange char**/calloc behavior
<p>When I debug the following code, <code>strncpy</code> works fine but as soon as the loop exits, I see that <code>parent_var_names</code> is pointing <code>NULL/0xfdfdfddf</code>. I am puzzled!</p>

<pre><code>parent_var_names = (const char**)calloc(net-&gt;nodes[x]-&gt;num_parents, sizeof(const char*));
for(int i(1); i &lt; net-&gt;nodes[x]-&gt;num_parents; ++i)
{
  parent_var_names[i] = (const char*)malloc(strlen(rhs_arr[net-&gt;nodes[x]-&gt;markov_parents[i]]));
  strncpy((char*)parent_var_names[i], (char*)rhs_arr[net-&gt;nodes[x]-&gt;markov_parents[i]], strlen(rhs_arr[net-&gt;nodes[x]-&gt;markov_parents[i]]));
}
</code></pre>
