X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Fwrite_entry.c;h=d205bdbe9725e91d2e4ce44c81e60ebcb1a11a52;hb=7d6371e47006c8aef4ac94f52998a35b03bf89cf;hp=843cc2ea35a0b6635b9e82df79229b36bc57b579;hpb=74137fec04e130a88ef25618cf730af988a4f51a;p=ncurses.git diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 843cc2ea..d205bdbe 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -50,7 +50,7 @@ #define TRACE_NUM(n) /* nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.104 2018/04/01 00:51:04 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.106 2018/06/23 21:35:06 tom Exp $") static int total_written; static int total_parts; @@ -171,7 +171,7 @@ make_db_root(const char *path) if ((rc = stat(path, &statbuf)) < 0) { rc = mkdir(path -#if !defined(__MINGW32__) +#if !defined(_WIN32) ,0777 #endif ); @@ -384,7 +384,9 @@ _nc_write_entry(TERMTYPE2 *const tp) } _nc_SPRINTF(filename, _nc_SLIMIT(sizeof(filename)) - LEAF_FMT "/%s", first_name[0], first_name); + LEAF_FMT "/%.*s", UChar(first_name[0]), + (int) (sizeof(filename) - LEAF_LEN - 2), + first_name); if (saved) first_name[limit2] = saved;