summaryrefslogtreecommitdiff
path: root/arm9/lib/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-06-11 16:43:28 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-06-11 16:43:28 -0400
commite052aae076e955cd58592b8c1c57e3f008c73040 (patch)
treeb5021245cdc51376335c20f64f84eb553d5d1a78 /arm9/lib/src
parentff782278c4c82a2d27e452775203d06c6d19fec3 (diff)
parente2d7f9f796889087a3da50f7eeb2383731ca3262 (diff)
Merge branch 'master' of github.com:martmists/pokediamond into pikalax_work
Diffstat (limited to 'arm9/lib/src')
-rw-r--r--arm9/lib/src/OS_alloc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arm9/lib/src/OS_alloc.c b/arm9/lib/src/OS_alloc.c
index 32f386a8..00028d3c 100644
--- a/arm9/lib/src/OS_alloc.c
+++ b/arm9/lib/src/OS_alloc.c
@@ -35,14 +35,12 @@ ARM_FUNC Cell *DLInsert(Cell *original, Cell *inserted)
{
Cell *prevCell = NULL;
Cell *nextCell = original;
-
- while (nextCell != NULL)
+
+ for (nextCell = original, prevCell = NULL; nextCell; prevCell = nextCell, nextCell = nextCell->next)
{
if (inserted <= nextCell)
break;
- prevCell = nextCell;
- nextCell = nextCell->next;
}
inserted->next = nextCell;