]> git.sesse.net Git - vlc/commitdiff
Correctly count the children of a node. The previous code counted the endpoints too...
authorJean-Paul Saman <jpsaman@videolan.org>
Sat, 14 Oct 2006 13:27:15 +0000 (13:27 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Sat, 14 Oct 2006 13:27:15 +0000 (13:27 +0000)
src/playlist/tree.c

index 9ff52e251aec97d4b0276cfa572c54a410cbf8bd..4d53d2935d18578bf21c5f198d39d40203995389 100644 (file)
@@ -247,13 +247,15 @@ int playlist_NodeChildrenCount( playlist_t *p_playlist, playlist_item_t*p_node)
 {
     int i;
     int i_nb = 0;
+
     if( p_node->i_children == -1 )
         return 0;
 
+    i_nb = p_node->i_children;
     for( i=0 ; i< p_node->i_children;i++ )
     {
         if( p_node->pp_children[i]->i_children == -1 )
-            i_nb++;
+            break;;
         else
             i_nb += playlist_NodeChildrenCount( p_playlist,
                                                 p_node->pp_children[i] );