aboutsummaryrefslogtreecommitdiff
path: root/pcb.c
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2015-04-01 20:09:02 -0400
committerBen Burwell <ben@benburwell.com>2015-04-01 20:09:02 -0400
commite468dc911189e71509012fb0ed228cc765f641fa (patch)
tree9a6f82214d1d4614640bd8a6b68a5d766d9f4e08 /pcb.c
parentc4ed6736d2e093ea7433328a552d53d3bcaff927 (diff)
as of 2013-10-072013-10-07
Diffstat (limited to 'pcb.c')
-rw-r--r--pcb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pcb.c b/pcb.c
index 8cffe3f..8f4034a 100644
--- a/pcb.c
+++ b/pcb.c
@@ -146,7 +146,9 @@ int insert_pcb(pcb **queue, pcb * addr, int method) {
current->next = addr;
addr->next = one_after;
addr->prev = current;
- one_after->prev = addr;
+ if (one_after != NULL) {
+ one_after->prev = addr;
+ }
} else {
// otherwise, put it at the head