Printing a char in C with printf wont print : <p>I have the following code: </p>

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

int main(void)
{
    char buff[50];
    int pass = 0;

    printf("\n Enter the password : \n");
    gets(buff);
    char str[80];
    strcat(str, "nw");
    strcat(str, "ww");
    strcat(str, "io");
    strcat(str, "oi");

    char str2[22];
    strcat(str2, "jm");
    strcat(str2, "qw");
    strcat(str2, "ef");
    strcat(str2, "io");
    strcat(str2, "nw");
    strcat(str2, "ce");
    strcat(str2, "or");
    strcat(str2, "ww");
    strcat(str2, "qf");
    strcat(str2, "ej");
    strcat(str2, "oi");


    if(strcmp(buff, str))
    {
        /*  we sf  as  df er fd xc yyu er we nm hj ui ty as asd qwe er t yu as sd df rt ty qw sd password    */

        printf ("\n Wrong Password \n");
    }

    else
    {
        printf ("\n Correct Password \n");
        pass = 1;
    }

    if(pass)
    {
        printf ("\n\n\n\n\n\n\n%s", str2);
    }

    return 0;
}
</code></pre>

<p>When I run it I get: </p>

<pre><code>root@images:~# ./root.flag

 Enter the password :
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

 Wrong Password







Segmentation fault (core dumped)
</code></pre>

<p>It prints the newline characters but not the value store in str2. How do I get str2 to print to the screen? Im fairly new to C so I have no clue why this is not working. It is likely something simple that I am overlooking.</p>
