title: Segfault in fgets
body: <pre><code>#include&lt;stdio.h&gt;
  #include&lt;malloc.h&gt;
  #define MAX_N 10000
  #define MAX_D 5000
  int main(){
          char* n = malloc(MAX_D);
          fgets(n,MAX_D,0);
          printf("\n n : %s \n",n);
          return 0;
  }
  </code></pre>
  
  <p>The above program results in segmentation fault. Couldn't identify the root cause.</p>