#define TRACE_NUM(n) /* nothing */
#endif
-MODULE_ID("$Id: write_entry.c,v 1.111 2019/01/20 02:54:14 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.114 2019/06/29 23:07:18 tom Exp $")
static int total_written;
static int total_parts;
_nc_warning("entry is larger than %u bytes", limit);
} else {
FILE *fp = ((_nc_access(filename, W_OK) == 0)
- ? fopen(filename, "wb")
+ ? fopen(filename, BIN_W)
: 0);
size_t actual;
_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)
check_writeable(ptr[0]);
_nc_SPRINTF(linkname, _nc_SLIMIT(sizeof(linkname))
- LEAF_FMT "/%s", ptr[0], ptr);
+ LEAF_FMT "/%.*s", ptr[0],
+ (int) sizeof(linkname) - (2 + LEAF_LEN), ptr);
if (strcmp(filename, linkname) == 0) {
_nc_warning("self-synonym ignored");