memchr returns unexpected characters : <p>I'm trying my best to understand the memchr function but having some issues with some simple output. I'm getting extra characters at the end of *newchar.</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

int main() {
    char plus[6] = "12+123";    
    char *newchar = (char*) memchr(plus,43,3);
    printf("%s",newchar);
}
</code></pre>

<p>output:</p>

<pre><code>+123( '
</code></pre>

<p>I expected to get "+123," why does it give me the extra characters? I noticed the output is consistent which confuses me earlier, it doesn't seem like these were grabbed from somewhere random in memory but were caused by the memchr function. </p>
