changeset 2219:c81f0a037059 vim73

And another small fix for persistent undo.
author Bram Moolenaar <bram@vim.org>
date Mon, 24 May 2010 22:06:04 +0200
parents 695ceebf17ca
children b1c70c500de4
files src/undo.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/undo.c
+++ b/src/undo.c
@@ -1025,10 +1025,10 @@ u_read_undo(name, hash)
             {
                 /* If we've had to move from the rightmost side of the table,
                  * we have to shift everything to the right by one spot. */
-                if (i < num_read_uhps - 1)
+                if (num_read_uhps - i - 1 > 0)
                 {
                     memmove(uhp_table + i + 2, uhp_table + i + 1,
-                            (num_read_uhps - i) * sizeof(u_header_T *));
+                            (num_read_uhps - i - 1) * sizeof(u_header_T *));
                 }
                 uhp_table[i + 1] = uhp;
                 break;