 <p><code>scanf</code> doesn't try to do a full pattern match of the format string. <code>%s</code> input format simply reads everything up to the next whitespace (or EOF). After that, it looks for a <code>;</code>, and since it doesn't find that it doesn't parse any of the other inputs.</p> <p>If you want to stop at some other character, use <code>[^char]</code></p> <pre><code>scanf("[^;];%[^=]=%s", id, banner, cp); </code></pre>