Преглед изворни кода

added edge case for deletion in lists

tarfeef101 пре 6 година
родитељ
комит
e3d159b674
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      kern/synchprobs/traffic_synch.c

+ 6 - 0
kern/synchprobs/traffic_synch.c

@@ -106,6 +106,12 @@ static void clearint(car * done)
   // first element of the list is being removed
   if (!(temp2))
   {
+    // if this is the only element
+    if (temp == active->back)
+    {
+      active->back == NULL;
+    }
+    
     active->front = active->front->next;
     goto SKIP1;
   }