X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Fadd_tries.c;h=9d215575fec02f710780bb7fac7d6eff886f8e06;hb=d1a029866f6d84087781eaa81de19949d8533426;hp=f9a4cce680a27a5215522fa9fe3712bb91d9308f;hpb=97cb42f22c43eb31a4bf11475bd73ab0e0b10923;p=ncurses.git diff --git a/ncurses/tinfo/add_tries.c b/ncurses/tinfo/add_tries.c index f9a4cce6..9d215575 100644 --- a/ncurses/tinfo/add_tries.c +++ b/ncurses/tinfo/add_tries.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2019 Free Software Foundation, Inc. * + * Copyright 2019-2020,2023 Thomas E. Dickey * + * Copyright 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,8 +39,9 @@ */ #include +#include -MODULE_ID("$Id: add_tries.c,v 1.11 2019/07/27 22:59:11 tom Exp $") +MODULE_ID("$Id: add_tries.c,v 1.13 2023/06/24 15:36:13 tom Exp $") #define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0' #define CMP_TRY(a,b) ((a)? (a == b) : (b == 128)) @@ -52,7 +54,7 @@ _nc_add_to_try(TRIES ** tree, const char *str, unsigned code) T((T_CALLED("_nc_add_to_try(%p, %s, %u)"), (void *) *tree, _nc_visbuf(str), code)); - if (txt == 0 || *txt == '\0' || code == 0) + if (!VALID_STRING(str) || *txt == '\0' || code == 0) returnCode(ERR); if ((*tree) != 0) {