#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.46 2022/09/17 21:44:35 tom Exp $")
#if NCURSES_XNAMES
/*
}
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 {