/****************************************************************************
- * Copyright 2018-2021,2022 Thomas E. Dickey *
+ * Copyright 2018-2022,2023 Thomas E. Dickey *
* Copyright 1999-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <tic.h>
-MODULE_ID("$Id: alloc_ttype.c,v 1.44 2022/06/18 20:40:54 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.49 2023/05/27 20:13:10 tom Exp $")
#if NCURSES_XNAMES
/*
int j, k;
DEBUG(3, (T_CALLED("adjust_cancels(%s), from(%s)"),
- to ? NonNull(to->term_names) : "?",
- from ? NonNull(from->term_names) : "?"));
+ NonNull(to->term_names),
+ NonNull(from->term_names)));
for (j = first; j < last;) {
char *name = to->ext_Names[j];
int j_str = to->num_Strings - first - to->ext_Strings;
}
str_size += strlen(src->term_names) + 1;
}
- for (i = 0; i < STRCOUNT; ++i) {
+ for_each_string(i, src) {
if (VALID_STRING(src->Strings[i])) {
if (pass) {
strcpy(new_table + str_size, src->Strings[i]);
dst->str_table = new_table;
} else {
++str_size;
- new_table = malloc(str_size);
+ if ((new_table = malloc(str_size)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
}
}
dst->ext_str_table = new_table;
} else {
++str_size;
- new_table = calloc(str_size, 1);
+ if ((new_table = calloc(str_size, 1)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
}
}
} else {
DEBUG(2, (T_RETURN("")));
}
-/*
- * This entrypoint is used by tack 1.07
- */
NCURSES_EXPORT(void)
_nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src)
{