#include <ctype.h>
-MODULE_ID("$Id: make_hash.c,v 1.11 2013/01/26 22:00:11 tom Exp $")
+MODULE_ID("$Id: make_hash.c,v 1.13 2013/09/28 20:55:47 tom Exp $")
/*
* _nc_make_hash_table()
static char *
strmalloc(char *s)
{
- char *result = malloc(strlen(s) + 1);
+ size_t need = strlen(s) + 1;
+ char *result = malloc(need);
if (result == 0)
- failed("strmalloc");
- strcpy(result, s);
+ failed("strmalloc");
+ _nc_STRCPY(result, s, need);
return result;
}
int col = 0;
- if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0)
+ if (list == 0 && (list = typeCalloc(char *, (MAX_COLUMNS + 1))) == 0)
return (0);
if (*buffer != '#') {