aboutsummaryrefslogtreecommitdiff
path: root/www/code.html
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-10-04 15:08:48 -0500
committerRob Landley <rob@landley.net>2016-10-04 15:08:48 -0500
commit346c33c8b22f6e6780d0a7132982a81512172a58 (patch)
treeeda7182f0b7da2555d942f2073ab77e6424a2190 /www/code.html
parentb22e7ad65963afcbc7281929e9d28d694aca36ea (diff)
downloadtoybox-346c33c8b22f6e6780d0a7132982a81512172a58.tar.gz
Explain dlist_terminate.
Diffstat (limited to 'www/code.html')
-rw-r--r--www/code.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/www/code.html b/www/code.html
index 77b0b211..bee139fa 100644
--- a/www/code.html
+++ b/www/code.html
@@ -861,8 +861,9 @@ won't warn you if you forget the &, but the code crashes pretty quickly in
that case.</p></li>
<li><p><b>How do I assemble a singly-linked-list in order?</b> - use
-a double_list, dlist_add() your entries, and then break the circle with
-<b>list->prev->next = NULL;</b> when done.</li>
+a double_list, dlist_add() your entries, and then call dlist_terminate(list)
+to break the circle when done (turning the last ->next and the first ->prev
+into NULLs).</p>
</ul>
<a name="lib_args"><h3>lib/args.c</h3>