X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fwrite_entry.c;h=5bb7aee7f3603ccd1e4cf27e97c44e62e653c9e8;hp=3d3e36aa23f8e1bbc9c6523fe98420fb252c618f;hb=7f4b9f390624835ceb0849965a7f6ff2dcb39d00;hpb=0de8912c1c0746eb37b733e9e6fdf852aab9506a diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 3d3e36aa..5bb7aee7 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * + * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,7 +51,7 @@ #define TRACE_NUM(n) /* nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.113 2019/03/23 23:47:16 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.116 2020/08/29 16:22:03 juergen Exp $") static int total_written; static int total_parts; @@ -191,7 +192,7 @@ make_db_root(const char *path) if ((rc = stat(path, &statbuf)) < 0) { rc = mkdir(path -#if !defined(_WIN32) +#ifndef _NC_WINDOWS ,0777 #endif ); @@ -405,7 +406,7 @@ _nc_write_entry(TERMTYPE2 *const tp) _nc_SPRINTF(filename, _nc_SLIMIT(sizeof(filename)) LEAF_FMT "/%.*s", UChar(first_name[0]), - (int) (sizeof(filename) - LEAF_LEN - 2), + (int) (sizeof(filename) - (LEAF_LEN + 2)), first_name); if (saved) @@ -466,7 +467,8 @@ _nc_write_entry(TERMTYPE2 *const tp) check_writeable(ptr[0]); _nc_SPRINTF(linkname, _nc_SLIMIT(sizeof(linkname)) - LEAF_FMT "/%.*s", ptr[0], (int) sizeof(linkname) - 3, ptr); + LEAF_FMT "/%.*s", ptr[0], + (int) sizeof(linkname) - (2 + LEAF_LEN), ptr); if (strcmp(filename, linkname) == 0) { _nc_warning("self-synonym ignored");