X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fdb_iterator.c;h=db3872e3f90d3e932ddd54bc35f5802026269f1a;hp=e69e0f34e71ccc66ff6ef26a50b790fcb02f3554;hb=HEAD;hpb=20db1fb41ec91cd8a1f528e770362092c5403378 diff --git a/ncurses/tinfo/db_iterator.c b/ncurses/tinfo/db_iterator.c index e69e0f34..db3872e3 100644 --- a/ncurses/tinfo/db_iterator.c +++ b/ncurses/tinfo/db_iterator.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2020,2022 Thomas E. Dickey * + * Copyright 2018-2022,2023 Thomas E. Dickey * * Copyright 2006-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -44,7 +44,7 @@ #include #endif -MODULE_ID("$Id: db_iterator.c,v 1.49 2022/04/23 20:03:15 tom Exp $") +MODULE_ID("$Id: db_iterator.c,v 1.50 2023/06/24 21:52:32 tom Exp $") #define HaveTicDirectory _nc_globals.have_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory @@ -383,8 +383,11 @@ _nc_first_db(DBDIRS * state, int *offset) */ for (j = 0; my_list[j] != 0; ++j) { #ifdef TERMINFO - if (*my_list[j] == '\0') - my_list[j] = strdup(TERMINFO); + if (*my_list[j] == '\0') { + char *my_copy = strdup(TERMINFO); + if (my_copy != 0) + my_list[j] = my_copy; + } #endif trim_formatting(my_list[j]); for (k = 0; k < j; ++k) {