X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Fbase%2Fkey_defined.c;fp=ncurses%2Fbase%2Fkey_defined.c;h=147e5fe2db93c9bac85c0acdaa637c5eb2830e50;hb=91494ab0071e71177728916199a406768f5ef963;hp=25d5a674e1b8524fef3d2233c9f80cd662288463;hpb=f79c210479470378389aab5b8d4d42d4a7f3d9a4;p=ncurses.git diff --git a/ncurses/base/key_defined.c b/ncurses/base/key_defined.c index 25d5a674..147e5fe2 100644 --- a/ncurses/base/key_defined.c +++ b/ncurses/base/key_defined.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2023 Thomas E. Dickey * * Copyright 2003-2006,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -32,8 +32,9 @@ ****************************************************************************/ #include +#include -MODULE_ID("$Id: key_defined.c,v 1.10 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: key_defined.c,v 1.11 2023/06/24 15:36:32 tom Exp $") static int find_definition(TRIES * tree, const char *str) @@ -41,7 +42,7 @@ find_definition(TRIES * tree, const char *str) TRIES *ptr; int result = OK; - if (str != 0 && *str != '\0') { + if (VALID_STRING(str) && *str != '\0') { for (ptr = tree; ptr != 0; ptr = ptr->sibling) { if (UChar(*str) == UChar(ptr->ch)) { if (str[1] == '\0' && ptr->child != 0) {