forked from speedie/spmenu
fix potential segmentation fault if clntext is NULL
This commit is contained in:
parent
9e2d297742
commit
6c927b8a7c
|
@ -107,8 +107,7 @@ moveup(const Arg *arg)
|
||||||
void
|
void
|
||||||
complete(const Arg *arg)
|
complete(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (!sel) return;
|
if (hideitem) return;
|
||||||
|
|
||||||
strncpy(text, sel->clntext, sizeof text - 1);
|
strncpy(text, sel->clntext, sizeof text - 1);
|
||||||
text[sizeof text - 1] = '\0';
|
text[sizeof text - 1] = '\0';
|
||||||
cursor = strlen(text);
|
cursor = strlen(text);
|
||||||
|
@ -284,7 +283,7 @@ selectitem(const Arg *arg)
|
||||||
{
|
{
|
||||||
char *selection;
|
char *selection;
|
||||||
|
|
||||||
if (sel && arg->i) {
|
if (sel && arg->i && !hideitem) {
|
||||||
selection = sel->text;
|
selection = sel->text;
|
||||||
} else {
|
} else {
|
||||||
selection = text;
|
selection = text;
|
||||||
|
|
Loading…
Reference in a new issue