strcmp crashes when comparing with a malloc array
<p>The strcmp cause the program to crash, Why is that? 
When removing strcmp it works well, and also with strcpy makes it crash </p>

<pre><code>size_t maxLineLen=1024;
char *line = (char*)malloc(maxLineLen);
while(getline(&amp;line, &amp;maxLineLen,stdin)!= -1){
int h =strlen(line);
for (int i = 0; i &lt; h; i++){
             if(strcmp(line[0], "a") == 0)  {
        printf("a found  %c \n ",line[i]);
            break;
        }

    }

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