title: Search and delete from linked list
body: <p>I'm having difficulties with this function.
  The function is supposed to search a student in a linked list and delete this node or print an error message if the student wasn't found. The following code does not work properly, it deletes the next node after the node which is being searched for.</p>
  
  <pre><code>void vymazstudenta(STUDENT **head,const char *priezvisko)
  {
      STUDENT *traverse = *head;
      while(traverse!=NULL)
      {
          if(!strcmp(traverse-&gt;priezvisko,priezvisko))
          {
          STUDENT *hladany = traverse-&gt;next;
          traverse-&gt;next = hladany-&gt;next;
          free(hladany);
          return;
          }
          traverse = traverse-&gt;next;
      }
          fprintf(stderr,"Student %s sa nenasiel.\n",priezvisko);
          return;
  }
  </code></pre>