diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-03 15:09:49 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-03 15:09:49 -0500 |
commit | a1646d84127a199fdacb6c5500d96e8829ebe8c1 (patch) | |
tree | eb7d59e50813108105a5bc4539191a3b008a320d /session.c | |
parent | d5488ef5c47878e04045a91d204cf1ccbdd9cd05 (diff) |
:shell, bugfixes
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -37,6 +37,8 @@ static void session_read_node(Ted *ted, FILE *fp) { } else { node->active_tab = read_u16(fp); u16 ntabs = clamp_u16(read_u16(fp), 0, TED_MAX_TABS); + if (node->active_tab >= ntabs) + node->active_tab = 0; for (u16 i = 0; i < ntabs; ++i) { u16 buf_idx = read_u16(fp); if (buf_idx >= TED_MAX_BUFFERS) continue; |