fix bugs in pdf_split_name_tree_node().

Sat, 08 Mar 2003 09:23:05 +0000

author
eric
date
Sat, 08 Mar 2003 09:23:05 +0000
changeset 88
a9991578aa3f
parent 87
870a093b587c
child 89
7a891425fa24

fix bugs in pdf_split_name_tree_node().

pdf_name_tree.c file | annotate | diff | revisions
     1.1 --- a/pdf_name_tree.c	Sat Mar 08 07:45:46 2003 +0000
     1.2 +++ b/pdf_name_tree.c	Sat Mar 08 09:23:05 2003 +0000
     1.3 @@ -4,7 +4,7 @@
     1.4   *      will be compressed using ITU-T T.6 (G4) fax encoding.
     1.5   *
     1.6   * PDF routines
     1.7 - * $Id: pdf_name_tree.c,v 1.5 2003/03/07 23:45:46 eric Exp $
     1.8 + * $Id: pdf_name_tree.c,v 1.6 2003/03/08 01:23:05 eric Exp $
     1.9   * Copyright 2003 Eric Smith <eric@brouhaha.com>
    1.10   *
    1.11   * This program is free software; you can redistribute it and/or modify
    1.12 @@ -167,7 +167,7 @@
    1.13    i++;
    1.14  
    1.15    /* move other entries right one position */
    1.16 -  if (i != node->count)
    1.17 +  if (i != parent->count)
    1.18      {
    1.19        memmove (& parent->kids [i+1],
    1.20  	       & parent->kids [i],
    1.21 @@ -206,7 +206,7 @@
    1.22  
    1.23    /* figure out in which slot to insert it */
    1.24    for (i = 0; i < node->count; i++)
    1.25 -    if (pdf_compare_obj (key, node->keys [i] < 0))
    1.26 +    if (pdf_compare_obj (key, node->keys [i]) < 0)
    1.27        break;
    1.28  
    1.29    /* move other entries right one position */
    1.30 @@ -235,7 +235,7 @@
    1.31  	  node->min_key = key;
    1.32  	}
    1.33      }
    1.34 -  else if (i == (node->count - 1))
    1.35 +  if (i == (node->count - 1))
    1.36      {
    1.37        node->max_key = key;
    1.38        while (node->parent && (node->parent->kids [node->parent->count - 1] == node))
    1.39 @@ -299,7 +299,7 @@
    1.40        pdf_set_dict_entry (node->dict, "Kids", kids);
    1.41      }
    1.42  
    1.43 -  if (! node->parent)
    1.44 +  if (node->parent)
    1.45      {
    1.46        /* write Limits array */
    1.47        struct pdf_obj *limits = pdf_new_obj (PT_ARRAY);