Patched bug(s) in postscipt driver
[pspp] / src / groff-font.c
index 835869af8e2a12bda4a92a4d9e404d16355cee2c..d645b278433d52ad3a8b000eb0d30828ade274f4 100644 (file)
@@ -600,19 +600,20 @@ add_kern (struct font_desc *font, int ch1, int ch2, int adjust)
       for (i = 0; i < font->kern_size; i++)
        font->kern[i].ch1 = -1;
 
-      for (i = 0; i < old_kern_size; i++)
-       {
-         if (old_kern[i].ch1 == -1)
-           continue;
-
-         j = hash_kern (old_kern[i].ch1, old_kern[i].ch2) % font->kern_size;
-         while (font->kern[j].ch1 != -1)
-           if (0 == j--)
-             j = font->kern_size - 1;
-         font->kern[j] = old_kern[i];
-       }
-      if (old_kern)
+      if (old_kern) {
+       for (i = 0; i < old_kern_size; i++)
+         {
+           if (old_kern[i].ch1 == -1)
+             continue;
+
+           j = hash_kern (old_kern[i].ch1, old_kern[i].ch2) % font->kern_size;
+           while (font->kern[j].ch1 != -1)
+             if (0 == j--)
+               j = font->kern_size - 1;
+           font->kern[j] = old_kern[i];
+         }
        pool_free (font->owner, old_kern);
+      }
     }
 
   for (i = hash_kern (ch1, ch2) % font->kern_size; font->kern[i].ch1 != -1;)