title: What am I doing wrong in my pop function (queue) C
body: <p>I have to write a program that implements a queue with all sorts of menu options (which are all done). I'm having trouble with my "pop" function. </p>
  
  <p>My program is a restaurant waiting list for employees. Whenever a customer calls in or comes into the restaurant they are put onto the waiting list. The only way to pop (be seated) is if the customer's status is waiting-in-restaurant. I have correctly written the portion that changes a customer from call-in to waiting in restaurant.</p>
  
  <p>Also, if the group size is bigger than the table size, I'm supposed to go to the next node and check if the next group fits the criteria to be seated. </p>
  
  <pre><code>enum status(WAIT,CALL);
  
  typedef struct restaurant
  {
  //stuff
  }list;
  
  //I call pop in the main as follows:
  
  pop(&amp;head, &amp;tail);   
  
  void pop(list** head, list** tail)
  {
      list* temp = *head;
      int tableSize;
  
      if(*head == *tail &amp;&amp; *tail == NULL)
      {
          printf("The queue is empty... exitting program... \n");
          exit(EXIT_FAILURE);
      }
  
      printf("What is the table size? ");
      scanf(" %d", &amp;tableSize);
  
      if(temp-&gt;groupSize &gt; tableSize || temp-&gt;waitStatus == CALL)
          while(temp-&gt;groupSize &gt; tableSize || temp-&gt;waitStatus == CALL)
              temp = temp-&gt;nextNode;
  
      else
          *head = (*head)-&gt;nextNode;
  
      if(*tail == temp)
          *tail = (*tail)-&gt;nextNode;
  
      free(temp);
  }
  </code></pre>
  
  <p>When I display my output it doesn't delete the node in the instance if it has to skip the first person in the queue. However, it does work when the first person meets the criteria. Why is this?</p>