#include <tic.h>
-MODULE_ID("$Id: read_entry.c,v 1.169 2023/06/15 20:51:06 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.171 2023/09/16 16:30:34 tom Exp $")
#define MyNumber(n) (short) LOW_MSB(n)
}
/* grab the name (a null-terminated string) */
- want = min(MAX_NAME_SIZE, (unsigned) name_size);
+ want = Min(MAX_NAME_SIZE, (unsigned) name_size);
ptr->str_table = string_table;
ptr->term_names = string_table;
if ((have = (unsigned) Read(ptr->term_names, want)) != want) {
offset = (int) (have - MAX_NAME_SIZE);
/* grab the booleans */
- TYPE_CALLOC(NCURSES_SBOOL, max(BOOLCOUNT, bool_count), ptr->Booleans);
+ TYPE_CALLOC(NCURSES_SBOOL, Max(BOOLCOUNT, bool_count), ptr->Booleans);
if (Read(ptr->Booleans, (unsigned) bool_count) < bool_count) {
returnDB(TGETENT_NO);
}
even_boundary(name_size + bool_count);
/* grab the numbers */
- TYPE_CALLOC(NCURSES_INT2, max(NUMCOUNT, num_count), ptr->Numbers);
+ TYPE_CALLOC(NCURSES_INT2, Max(NUMCOUNT, num_count), ptr->Numbers);
if (!read_numbers(buf, num_count)) {
returnDB(TGETENT_NO);
}
convert_numbers(buf, ptr->Numbers, num_count);
- TYPE_CALLOC(char *, max(STRCOUNT, str_count), ptr->Strings);
+ TYPE_CALLOC(char *, Max(STRCOUNT, str_count), ptr->Strings);
if (str_count) {
/* grab the string offsets */
int reccnt = 0;
char *save = strdup(name);
+ if (save == 0)
+ returnDB(code);
+
memset(&key, 0, sizeof(key));
key.data = save;
key.size = strlen(save);