title: C - Process returned 139 (0x8B) Segmentation fault
body: <p>I'm new in C so i tried to make a z-funtion program, but as a result of compilation, after enter any input information I have "Process returned 139 (0x8B) Segmentation fault"</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  #include &lt;string.h&gt;
  
  char s[10001];
  int main(void)
  {
  fgets(s, 10001,stdin);
  int mas[strlen(s)];
  int i, k = 0, help = 0, len = strlen(s);
  for (i = 1; i &lt; len; i++)
  {
      if (i &lt;= help)
      {
          printf(" i = %d,help = %d ", i,help);
          mas[i] = fmin(mas[i - k], help - i + 1);
      }
      while (i + mas[i] &lt; len)
      {
          if (s[i + mas[i]] == s[mas[i]])
          {
              mas[i]++;
          }
          else
          {
              break;
          }
      }
  
      if (mas[i] &gt; 0 &amp;&amp; i + mas[i] - 1 &gt; help)
      {
          k = i;
          help = i + mas[i] - 1;
      }
      printf("%d",mas[i]);
  }
  return 0;
  }
  </code></pre>