summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-03 15:09:49 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-03 15:09:49 -0500
commita1646d84127a199fdacb6c5500d96e8829ebe8c1 (patch)
treeeb7d59e50813108105a5bc4539191a3b008a320d /session.c
parentd5488ef5c47878e04045a91d204cf1ccbdd9cd05 (diff)
:shell, bugfixes
Diffstat (limited to 'session.c')
-rw-r--r--session.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/session.c b/session.c
index 4895f34..ac76511 100644
--- a/session.c
+++ b/session.c
@@ -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;