title: program crashes at repetitive calloc() call
body: <p>Edit: solved by kaylums little comment. Thank you!</p>
  <p>good morning,
  I am relatively new to C still and I'm trying to make a doubly linked list.
  I got my program to run properly with all the functions with this kind of element:</p>
  <p>the program crashes after either 2 or 3 inserted elements in the list in the calloc() call of my insertElement() function. I don't get any SIGSEGV or anything, the program just stops with a random negative return.
  I'll try to give a minimum code example of the function and the function call:</p>
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  typedef struct Element {
      char name[30];
  }Element;
  
  typedef struct List {
      int size;
      Element* first;
      Element* last;
  }List;
  
  
  
  Element* insertElement(List* List, char name[30]) {
      Element* element;
      element = (Element*)calloc(0, sizeof(Element));
      strncpy_s(element-&gt;name, name, 30);
      return element;
  }
  
  List globalList;
  char name[30];
  
  int main() {
      while (true) {
          printf(&quot;insert the name &gt;&gt;&quot;);
          if (fgets(name, 30, stdin) != NULL)
              name[strcspn(name, &quot;\n&quot;)] = 0;
          insertElement(&amp;globalList, name);
      }
  }
  </code></pre>
  <p>is there already something obvious wrong with that basic stuff?
  Thank you very much in advance! Any advice would be very much appreciated, have a good day!</p>