X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=dict.c;h=68703dafc603bf377ae3688f1dff78e0a7028cb0;hb=32ecf2fa7f7f91e8b4d0d3a5bf40314fda1090fb;hp=b23da18b6024aca02e68a605a3a8037b56821eee;hpb=0dd9b1cd908b90236fba38ef4d7402c8fbcbb99b;p=wordgame diff --git a/dict.c b/dict.c index b23da18..68703da 100644 --- a/dict.c +++ b/dict.c @@ -1,7 +1,7 @@ /* * Copyright © 2006 Carl Worth * - * This program is free software; you can redistribute it and\/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. @@ -227,10 +227,11 @@ trie_for_each_of_length_if (trie_t *trie, { count = 1; - action (closure, string->s, &trie->flags); + if (action) + action (closure, string->s, &trie->flags); } - if (length == max_length) + if (max_length > 0 && length == max_length) return count; /* Loop over each element, appending the character and recursing. */