X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fmake_hash.c;h=37ac7651424c779a8bd0586ca3aa25c02e488ce6;hp=31f21005f4187c639084c3edc4e65e1cb66581bf;hb=6a530b46563470c2ca73579d1994a0c8e275dd98;hpb=f486c68b1efe3bab5739c3f464fde6685a52bee5 diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c index 31f21005..37ac7651 100644 --- a/ncurses/tinfo/make_hash.c +++ b/ncurses/tinfo/make_hash.c @@ -44,7 +44,7 @@ #include -MODULE_ID("$Id: make_hash.c,v 1.12 2013/02/16 21:27:50 tom Exp $") +MODULE_ID("$Id: make_hash.c,v 1.13 2013/09/28 20:55:47 tom Exp $") /* * _nc_make_hash_table() @@ -69,10 +69,11 @@ failed(const char *s) 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; }