0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

And another small fix for persistent undo.

This commit is contained in:
Bram Moolenaar
2010-05-24 22:06:04 +02:00
parent 6a244fefd9
commit 9d72807646

View File

@@ -1025,10 +1025,10 @@ u_read_undo(name, hash)
{ {
/* If we've had to move from the rightmost side of the table, /* If we've had to move from the rightmost side of the table,
* we have to shift everything to the right by one spot. */ * 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, 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; uhp_table[i + 1] = uhp;
break; break;