aboutsummaryrefslogtreecommitdiff
path: root/c++/cursslk.cc
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 08:11:38 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 08:11:38 +0000
commit24fa7a5107c5b75d1c197accf0305be64bc72882 (patch)
tree183f09c93417ac0e5f7f49760329a3d2cfaacda9 /c++/cursslk.cc
parentbf0ab54638a5ef969749f6ceae30e864f9556ea8 (diff)
Diffstat (limited to 'c++/cursslk.cc')
-rw-r--r--c++/cursslk.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/c++/cursslk.cc b/c++/cursslk.cc
index 9922163cd360..7b898cefff7d 100644
--- a/c++/cursslk.cc
+++ b/c++/cursslk.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2022,2023 Thomas E. Dickey *
* Copyright 1998-2005,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -36,7 +36,7 @@
#include "cursslk.h"
#include "cursesapp.h"
-MODULE_ID("$Id: cursslk.cc,v 1.19 2020/07/18 19:57:11 anonymous.maarten Exp $")
+MODULE_ID("$Id: cursslk.cc,v 1.21 2023/02/25 23:36:06 tom Exp $")
Soft_Label_Key_Set::Soft_Label_Key&
Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text)
@@ -56,7 +56,11 @@ Soft_Label_Key_Set::Label_Layout
void Soft_Label_Key_Set::init()
{
- slk_array = new Soft_Label_Key[num_labels];
+ if (num_labels > 12)
+ num_labels = 12;
+ if (num_labels < 0)
+ num_labels = 0;
+ slk_array = new Soft_Label_Key[num_labels + 1];
for(int i=0; i < num_labels; i++) {
slk_array[i].num = i+1;
}